Sign in to follow this  

Как вывести картинку товара в окне модуля Купить аз 1 клик?

Recommended Posts


В /app/Plugin/ModuleOneClickBuy/Controller/BuyConroller.php меняйте:

		$this->set('content_name', $content_description['ContentDescription']['name']);


		$this->set('content_name', $content_description['ContentDescription']['name']);

		App::import('Model', 'ContentImage');
		$ContentImage = new ContentImage();

		$ContentImage = $ContentImage->find('first', array('conditions' => array('ContentImage.content_id' => $content_id)));

		$this->set('content_image', $ContentImage['ContentImage']['image']);

и затем в шаблоне окна /app/Plugin/ModuleOneClickBuy/View/form.ctp выводить название картинки меткой:

<?php echo $content_image; ?>

Ну а дальше просто используйте img src ...:

<img src="/img/content/<?php echo $content_image; ?>" alt="" />

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this