Post by dimitris212 » Fri Jul 03, 2020 5:02 pm

Hello, if I have discount prices for more than one product can it be label?
Not Special but Discount.

Active Member

Posts

Joined
Fri Oct 19, 2012 2:11 am

Post by Johnathan » Fri Jul 03, 2020 11:26 pm

No, only Special prices can change the display of the price. Discount prices will show up on the product page in their table, and will affect the price after the item has been added to the cart, but not beforehand since the discount depends on the quantity added to cart.

I haven't ever seen a mod that changes this, but you can try looking in the opencart.com marketplace (https://www.opencart.com/index.php?rout ... /extension). If you can't find anything there, you may need to hire someone to write a custom modification for you. If you need to find a developer, you can post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by dimitris212 » Sun Jul 05, 2020 11:14 pm

No, I don't mean that.
When I have discounted prices, I want one to appear a label on product image.
for example https://ibb.co/N9cGsYf

Active Member

Posts

Joined
Fri Oct 19, 2012 2:11 am

Post by Johnathan » Sun Jul 05, 2020 11:17 pm

Ah, got it. You'll need a mod for that --- search for "image label" or "image sticker" in the opencart.com marketplace (https://www.opencart.com/index.php?rout ... /extension). I know there are lots of extensions that can do that, but you'll need to find one that works with your theme. You can ask the developer about whether it would be compatible, and they may know whether it would work.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by dimitris212 » Sun Jul 05, 2020 11:54 pm

Can you suggest me one because I can't find it, please.

Active Member

Posts

Joined
Fri Oct 19, 2012 2:11 am

Post by simple-opencart » Mon Jul 06, 2020 12:43 am

Good day!

I could offer you my module
https://www.opencart.com/index.php?rout ... n_id=38279

It can add auto stickers for discounted products.

See screenshots
https://prnt.sc/tc9e36
https://prnt.sc/tc9e71
https://prnt.sc/tc9ej4


Posts

Joined
Fri Oct 19, 2018 4:01 pm

Post by dimitris212 » Mon Jul 06, 2020 5:55 pm

simple-opencart wrote:
Mon Jul 06, 2020 12:43 am
Good day!

I could offer you my module
https://www.opencart.com/index.php?rout ... n_id=38279

It can add auto stickers for discounted products.

See screenshots
https://prnt.sc/tc9e36
https://prnt.sc/tc9e71
https://prnt.sc/tc9ej4
Hi, i send you pm.

Active Member

Posts

Joined
Fri Oct 19, 2012 2:11 am

Post by i.am.retailer » Thu Jul 16, 2020 12:32 pm

Hi you can do this via coding changes as you need to display in product item
first pass the value from controller to template file with the below code
catalog>>controller>>product>>category.php
add inside products for loop

Code: Select all

$discounts = $this->model_catalog_product->getProductDiscounts( $result['product_id']);
then append this discount value inside your products array data

Code: Select all

$data['products'][] = array(
					'product_id'  => $result['product_id'],
					'thumb'       => $image,
					'name'        => $result['name'],
					'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
					'price'       => $price,
					'special'     => $special,
					'tax'         => $tax,
					'minimum'     => $result['minimum'] > 0 ? $result['minimum'] : 1,
					'rating'      => $result['rating'],
					'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url),
					'discounts'  => $discounts,
				);
then in catalog>>view>>theme>>default>>template>>product>>category.twig . write this code where everever you need to add your label

Code: Select all

{% if product.discounts %}Add your required label {% endif %}
Last edited by i.am.retailer on Thu Jul 16, 2020 2:03 pm, edited 2 times in total.

New member

Posts

Joined
Thu Jun 04, 2020 2:10 pm

Post by sw!tch » Thu Jul 16, 2020 1:36 pm

i.am.retailer wrote:
Thu Jul 16, 2020 12:32 pm
Hi you can do this via coding changes as you need to display in product item
first pass the value from controller to template file with the below code
catalog>>controller>>product>>category.php
add
$discounts = $this->model_catalog_product->getProductDiscounts( $result['product_id']);
And add 'discounts' =>$discounts, to the product array data.

then in catalog>>view>>theme>>default>>template>>product>>category.twig . write this code {% if product.discounts %}<Add value product.discounts with design where ever you need> {% endif %}
If you are going to offer code solutions, use code tags and a proper line for the OP to reference. Please don't post half baked code, it will just lead to the OP (and others who reference this post) coming back wondering why their store is broke.

Backup and [ learn how to recover ] before you make any changes.


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Who is online

Users browsing this forum: No registered users and 23 guests