Jump to content
Sign in to follow this  
kibyury

как реализовать на модуле Product Series 1.5 вывод цены и статус наличие в каждом дополнительном тов

Recommended Posts

Добрый день! Никто не подскажет как реализовать на модуле Product Series 1.5 вывод цены и статус наличие в каждом дополнительном товаре?

 

 

Прописываю такой код(для вывода статуса наличия, выводит фразу 'text_stock', а после нее ниче не выводит):

$stock_q = $this->language->get('text_stock') . ' ';
                 if ($result['quantity'] <= 0) {
     $stock .= $result['stock_status'];
     } elseif ($this->config->get('config_stock_display')) {
     $stock .= $result['quantity'];
     } else {
     $stock .= $this->language->get('text_instock');
    }

Ввесь код:

<file name="catalog/controller/product/product.php">
		<operation error="log">
			<search position="before"><![CDATA[$this->model_catalog_product->updateViewed($this->request->get['product_id']);]]></search>
			<add><![CDATA[//BOF Product Series 
			//get link of linked products + colors
			$pds_allow_buying_series = $this->getData('pds_allow_buying_series', 0);
			$results = $this->model_catalog_product->getLinkedProducts($this->request->get['product_id'], '2', $pds_allow_buying_series); //'2' is Image
			
			$this->data['pds'] = array();
			
			$pds_detail_thumbnail_width = $this->getData('pds_detail_thumbnail_width', 50);
			$pds_detail_thumbnail_height = $this->getData('pds_detail_thumbnail_height', 50);
			$pds_preview_width = $this->getData('pds_preview_width', 200);
			$pds_preview_height = $this->getData('pds_preview_height', 200);
			$this->data['pds_enable_preview'] = $this->getData('pds_enable_preview', 1);
			
			
			
			
			foreach ($results as $result)
			{
				$product_pds_image = $result['special_attribute_value'] != ''
					? $this->model_tool_image->resize($result['special_attribute_value'], $pds_detail_thumbnail_width, $pds_detail_thumbnail_height)
					: $this->model_tool_image->resize($result['image'], $pds_detail_thumbnail_width, $pds_detail_thumbnail_height);
				
				$product_main_image = ($result['image'] != '' && $result['image'] != 'no_image.jpg')
					? $this->model_tool_image->resize($result['image'], $pds_preview_width, $pds_preview_height) //user default main image
					: $this->model_tool_image->resize($result['special_attribute_value'], $pds_preview_width, $pds_preview_height); // use series image
			
				$stock_q = $this->language->get('text_stock') . ' ';
				 if ($result['quantity'] <= 0) {
                                 $stock .= $result['stock_status'];
                                 } elseif ($this->config->get('config_stock_display')) {
                                 $stock .= $result['quantity'];
                                 } else {
                                 $stock .= $this->language->get('text_instock');
                                 }
		
			
				$this->data['pds'][] = array(
					'product_id' => $result['product_id'],
					'product_link' => $this->url->link('product/product', $url . '&product_id=' . $result['product_id']),
					'product_name' => $result['name'],
					'product_stock' => $stock_q,
					'product_pds_image' => $product_pds_image,
					'product_main_image' => $product_main_image
				);
				
				
			}
			
			$this->load->model('catalog/product_master');
			$this->load->language('product/pds');
			
			if(!isset($this->data['display_add_to_cart']))
			{
				$is_master = $this->model_catalog_product_master->isMaster($this->request->get['product_id'], '2'); //2 is Image
				$pds_allow_buying_series = $this->getData('pds_allow_buying_series', 0);
				$this->data['display_add_to_cart'] = !$is_master || $pds_allow_buying_series;
				$this->data['no_add_to_cart_message'] = $this->language->get('text_select_series_item');
			}
			
			$this->data['text_in_the_same_series'] = $this->language->get('text_in_the_same_series');
			//EOF Product Series ]]></add>
		</operation>
	</file>

Share this post


Link to post
Share on other sites

Так же интересно, может кто нибудь поможет?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.