reduce the original price of the product

  • Posts: 25
  • Thank you received: 0
11 years 5 months ago #107850

We are working on a shop that sales car components.
Each component has a selectable option „With installation “.
When the user adds a component to the cart with this option the original price of the component should be reduced to 10% i.e. 10 euro instead of the orinal 100 euro
In other words the cart should show the original price and the reduced price and the reduce price is actually the price to pay.
Do you have any idea how to achieve this?
Many thanks in advance.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #107887

Hi,

You can create an auto loaded coupon applied on the category where the option "with installation" is, and when the customer arrive at the checkout the coupon will be loaded and the discount of 10% will be applied.

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

  • Posts: 25
  • Thank you received: 0
11 years 5 months ago #107957

Thank you for your reply!

Unfortunately its not exactly what i'm trying to achieve.

I must recalculate (set down) the product price iself, not the price of the option.
So if the user adds for example a wheel with the option "with installation" to the cart, the price of the wheel should be set down to 10% of its original price.

I have the following idea:

Step 1. Adding a custom item field to a product.
Step 2. When the user selects an option "with installation" it will trigger a javascript that changes the value of the custom item field.
Step 3. This change will be used to trigger the function „onBeforeCalculateProductPriceForQuantity“ as you describe in the developer quide.
Step 4. Invoke custom function „hikashop_product_price_for_quantity_in_cart“ to recalculate the product price.

Do you think it will work?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #107970

Hi,

Using a product custom field is a good idea, but the best solution would be to create a plugin which will be launched through the onAfterCartProductsLoad trigger, then you'll just have to add the value of your product custom field in the total price if the product's option is in the cart.

Hope this will help you a little.

Last edit: 11 years 5 months ago by Mohamed Thelji.
The following user(s) said Thank You: aleks59

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

Time to create page: 0.049 seconds
Powered by Kunena Forum