How can I add a discount to a product?

  • Posts: 65
  • Thank you received: 4
9 years 4 months ago #238091

-- 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.

  • Posts: 84310
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #238108

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:

$text.=' ( '.($positive?'+ ':'').$this->currencyHelper->format($price,$ok->price_currency_id).' )';
you can have:
$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.

  • Posts: 65
  • Thank you received: 4
9 years 4 months ago #238358

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

Attachments:
Last edit: 9 years 4 months ago by dilum_tharaka.

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

  • Posts: 84310
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #238369

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.

  • Posts: 65
  • Thank you received: 4
9 years 4 months ago #238461

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.

$text.=' '.($positive?'+ ':'').$this->currencyHelper->format($price,$ok->price_currency_id).' <s>'.$variant->custom_discount.'</s>';

But still it's not appearing.

Thanks

Attachments:

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

  • Posts: 84310
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #238490

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.

  • Posts: 65
  • Thank you received: 4
9 years 4 months ago #238623

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.

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #238646

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.

  • Posts: 65
  • Thank you received: 4
9 years 4 months ago #238744

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.

  • Posts: 84310
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #238768

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.089 seconds
Powered by Kunena Forum