Skip to main content

How can I add a discount to a product?

More
10 years 5 months ago #238091 by dilum_tharaka
-- url of the page with the problem -- : mausfish.com/shop-online/fly-mouse
-- HikaShop version -- : 2.6.2
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.4.43
-- Browser(s) name and version -- : Mozilla Firefox 45.0.2

Hello,
I need to give a discount to my product and it should appear like this joxi.ru/Grqdx1JhNOe7MA .
How can I do this with hikashop?

Thanks

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238108 by nicolas
Hi,

You'll have to add a custom product field via the menu Display>custom field in order to enter the original price in your option variant and then edit the file "option" of the view "product" via the menu Display>views and add the display of the custom field next to the price.
So instead of:
Code:
$text.=' ( '.($positive?'+ ':'').$this->currencyHelper->format($price,$ok->price_currency_id).' )';
you can have:
Code:
$text.=' '.($positive?'+ ':'').$this->currencyHelper->format($price,$ok->price_currency_id).' <s>'.$variant->custom_field.'</s>';
where custom_field is to be replaced by the column name of the custom field.
The following user(s) said Thank You: dilum_tharaka

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #238358 by dilum_tharaka
Hello Nicolas Thanks for the reply.

I created a custom product field, and edited the 'option' of the of the view 'product'. But still the original price is not displaying in the option variant.

(screenshot is attached)

Thanks,
Dilum
Last edit: 10 years 5 months ago by dilum_tharaka.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238369 by nicolas
Hi,

Please make sure that you edited the file for the template you're using on your frontend.
Also, that line of code is twice in the file, make sure that you remplace both.
Finally, make sure that you entered something in the variants of the option product in that custom field.
The following user(s) said Thank You: dilum_tharaka

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238461 by dilum_tharaka
Hi Nicloas,
I edited option file for my template, and you were right code was in two places, I only had replaced 1 place, so I did the changes.
Code:
$text.=' '.($positive?'+ ':'').$this->currencyHelper->format($price,$ok->price_currency_id).' <s>'.$variant->custom_discount.'</s>';

But still it's not appearing.

Thanks

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238490 by nicolas
Hi,

OK, I went and checked your website but you're not using an option, you're using a characteristic
In that case, the text in the dropdown comes from the variant name.
So you can directly change the text in the variants name when you edit them in the product's variants tab.
The following user(s) said Thank You: dilum_tharaka

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238623 by dilum_tharaka
Hello Nicolas,
How can I change it from the product's variant tab? I can only rename the variant through products>characteristics. Though I can change it from the characteristics I can't use html tags inside. for example: <del>$9.95</del>

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238646 by Xavier
Hi,

From the product edition page, you should be able to see a "Variants" tab at the top.
Go in this tab and then you can edit the name of your variants.
The following user(s) said Thank You: dilum_tharaka

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238744 by dilum_tharaka
Thanks for replying,
Can I add html codes, to variants.for example: <del>$9.95</del>

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #238768 by nicolas
Hi,

You can but it won't work in a dropdown. Dropdowns don't handle HTML tags.
The following user(s) said Thank You: dilum_tharaka

Please Log in or Create an account to join the conversation.

Time to create page: 0.242 seconds
Powered by Kunena Forum