but i got some error:
Fatal error: Call to undefined method ModelCatalogProduct::hasOptionPriceIncrease() in /home2/k6q1s3k7/mycoffeelab.ph/vqmod/vqcache/vq2-catalog_controller_product_category.php on line 250
how to resolve this thing thanks!
Add the following function to \catalog\model\catalog\product.php
Code: Select all
public function hasOptionPriceIncrease($product_id) {
$option_data = $this->getProductOptions($product_id);
if (is_array($product_option_value)) {
foreach ($product_option_value as $option) {
if (is_array($option['product_option_value'])) {
foreach ($option['product_option_value'] as $value) {
if ($value['price'] > 1) {
return true;
}
}
}
}
}
return false;
}
}
Code: Select all
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $result['rating'],
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url),
'has_option_price_increase' =>$this->model_catalog_product->hasOptionPriceIncrease($result['product_id'])
);
Code: Select all
<p class="price">
<?php if ($product['has_option_price_increase']) { echo 'From'; } ?>