Page 1 of 1

text before price FROM

Posted: Thu Apr 30, 2015 12:31 am
by zunox
Is there exist module which can add to product which i want before price from.

Price from 10€ for example.

im using opencart 2.0.1.1

thanks

Re: text before price FROM

Posted: Fri May 01, 2015 1:46 am
by rph
You can edit the template files if you want to try a solution yourself. For example, edit category.tpl and change code like:

Code: Select all

<?php echo $product['price']; ?>
to

Code: Select all

FROM <?php echo $product['price']; ?>
I also have a mod called Display Low Price which does this. It's only for 1.5.x right now but I'll be porting it over to 2.x in the next week or two.

Re: text before price FROM

Posted: Fri May 01, 2015 3:32 pm
by zunox
i dont want add this to all products, just on some which i want to

Re: text before price FROM

Posted: Fri May 01, 2015 11:21 pm
by rph
This may be a job best suited for a developer. A very quick and dirty method would be:

Code: Select all

<?php if (in_array($product['product_id'], ['15', '25', '35'])) { ?>FROM<?php } ?> <?php echo $product['price']; ?>
where you replace the numbers (15, 25, 35) with the appropriate product_ids.

Re: text before price FROM

Posted: Sat May 02, 2015 1:58 am
by zunox
Is possible to add that to the whole category ?

Re: text before price FROM

Posted: Sat May 02, 2015 2:06 am
by rph
Sure. Just modify the code so it's a category_id check.

Re: text before price FROM

Posted: Sat May 02, 2015 2:50 am
by zunox
i change code to:

Code: Select all

<?php if (in_array($product['category_id'], ['15', '25', '35'])) { ?>FROM<?php } ?> <?php echo $product['price']; ?>
and insert category id but it dont work

Re: text before price FROM

Posted: Sat May 02, 2015 3:28 am
by rph
Yes, you need to rewrite the code. I already provided two fish. The third one is up to you to catch.

Re: text before price FROM

Posted: Sun May 03, 2015 4:24 am
by zunox
i get the error:

Notice: Undefined index: category_id in /home/majicena/public_html/trgovina/vqmod/vqcache/vq2-catalog_view_theme_default_template_product_category.tpl on line 141

that line is:

Code: Select all

<?php } ?>
      <?php if (!$categories && !$products) { ?>
      <p><?php echo $text_empty; ?></p>