Post by reactivemedia » Tue Jun 23, 2015 9:18 pm

Hi,

I would like to add the word "From" before the price on my opencart V2 category page for items which have options that change the price - I have seen this tutorial and implemented, but nothing appears, can anyone assist me please,

Link - https://stackoverflow.com/questions/291 ... 839aabb32c

Thanks in advance

Newbie

Posts

Joined
Tue Jun 23, 2015 9:15 pm

Post by IP_CAM » Thu Jun 25, 2015 7:58 am

It relatively easy to do, the FOLLOWING Line, you will find in ALL your Files, related to display Pricing, within the
\catalog\view\theme\default\template\product\ - Sub-Section!

BE AWARE of the Fact, that Product-Price-related VQ-MODS / OC-MODS, possibly accessing/using this LINE, in it's COMPLETE FORM, using it as ANCHOR, to 'enable' their function, would NOT longer work, exept, if you place the MODIFIED Line into a MOD as well, so enabling it again to read out/identify this anchor-line!

In OC Version 1.5.6.x, IT'S THIS LINE:

Code: Select all

<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
should look like:
<span class="price-old"><?php echo $product['price']; ?></span><br />starting from: <span class="price-new"><?php echo $product['special']; ?></span>
In OC Version 2.0.3.x, IT'S THIS LINE:

Code: Select all

<span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
should look like:
<span class="price-new"><?php echo $product['special']; ?></span><br />starting from: <span class="price-old"><?php echo $product['price']; ?></span>
Should be no problem to find it, and change, to make it look like on the image below.
Good Luck
Ernie
hitline.info/shop/
UNTESTED ON v.2.0.x.x !!

A bigger/better Image:
http://www.ipc.li/os/prices_from_amount_l.jpg

Attachments

prices_from_amount_s.jpg

Place Text before Product Price - prices_from_amount_s.jpg (306.13 KiB) Viewed 921 times


Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by zekin » Mon Aug 31, 2015 1:53 pm

I implemented it too, but get nothing but error message. I already used product_option_value instead of option_value.

My OC version : 2.0.3.1

My OC sites:
Top Choice Variety
Tiny World


New member

Posts

Joined
Wed Nov 21, 2012 8:13 pm

Post by zekin » Wed Sep 02, 2015 10:40 am

Just want to add that, I fixed the issue. The code in stackoverflow has a small error, here is the correct one:

In OC 2.0, need Add the following function to \catalog\model\catalog\product.php INSTEAD:

Code: Select all

public function hasOptionPriceIncrease($product_id) {
  $option_data = $this->getProductOptions($product_id);
    if (is_array($option_data)) {
      foreach ($option_data as $option) {
      if (is_array($option['product_option_value'])) {
        foreach ($option['product_option_value'] as $value) {
          if ($value['price'] > 1) {
            return true;
          }
        }
      }
    }    
  }
  return false;
}

My OC sites:
Top Choice Variety
Tiny World


New member

Posts

Joined
Wed Nov 21, 2012 8:13 pm
Who is online

Users browsing this forum: No registered users and 22 guests