2

Pleas help me out for this minor issues.

I want to remove the original value price from the addition of total optional value price from the cart in OpenCart 3.0.

Reference URL.

When you add option and hit add to cart. After when we open the cart symbol at top right cart, the original price also added.

UPDATED

Thanks for your reply.

I want to display minimum price on home page. So, can I show the product's minimum price from the optional value.

For Example: I have three varieties of products.

  • Prod 1 ($10)
  • Prod 2 ($20)
  • Prod 3 ($30)

I want to display Prod 1 ($10) on my home page. That's it. How to do that?

Appreciate your reply..

focus.style
  • 6,612
  • 4
  • 26
  • 38
Yoonus
  • 33
  • 3

1 Answers1

1

In this case you can set original price to 0.

or

You can set main product price = to minimal option price, then set your option prices like:

  1. +0
  2. +10
  3. +20

That's how options in OpenCart works.

UPDATED

Set your product price to $10. Then set your options' prices to:

  1. +0
  2. +10
  3. +20

UPDATE 2

Using previous update, to see full price in option lets make following changes:

open catalog/controller/product/product.php, find

$product_option_value_data[] = array(
  'product_option_value_id' => $option_value['product_option_value_id'],
  'option_value_id'         => $option_value['option_value_id'],
  'name'                    => $option_value['name'],
  'image'                   => $this->model_tool_image->resize($option_value['image'], 50, 50),
  'price'                   => $price,
  'price_prefix'            => $option_value['price_prefix']
);

This line

'price'                   => $price,

replace with

'price'                   => $this->currency->format($option_value['price'] + $product_info['price'], $this->session->data['currency']),

Update your ocmod cache and now you will see (main price + option price) value in options on product page. And set you option from chackbox to radio.

focus.style
  • 6,612
  • 4
  • 26
  • 38
  • Updated the answer, check please. – focus.style Jul 13 '20 at 08:17
  • Thanks a lot. But I don't want to show the addition of charges with the product price. Whatever the price is shown on optional value will be added in the cart. Product Price : 10$ Option Value: 20$ Once I clicked Option Value, only 20$ should bee shown in the cart. Not 10$. :-) – Yoonus Jul 13 '20 at 12:58
  • Updated the answer. Do everything from UPDATE and UPDATE 2 – focus.style Jul 13 '20 at 14:25
  • Awesome. Thank you so much. One more last thing, I want to add only Optional Prices in the cart as total using checkbox. I don't want to include Original Price.. Because I will remove the original price from the product page. Please help me out from this. Highly appreciated your reply.. – Yoonus Jul 13 '20 at 16:49
  • Set your product price to $10. Then set your options' prices to: +0, +10, +20. And then changes to controller. Have you done it? Because this is the only way to easy solve this task? – focus.style Jul 13 '20 at 16:57
  • I have done it. It works perfect as what you told :). But I should use checkboxes because client need to provide option for their customers. So the total conflicts when I use multiple checkboxes. Please check this url: https://mrkayal.com/index.php?route=product/product&path=89_91&product_id=109 – Yoonus Jul 13 '20 at 17:07
  • Yeah, it's not gonna work with checkboxes as expected. I'm sorry, but that's how opencart works, it addes option price to main price in cart. Is there any way to use radiobox (OR switcher) instead of checkbox (see in option settings)? Like it could be just "MINI SANDWICH" with price 10. And there are ingredients - mutton +0, chicken +10, beef +20, and customer can pick only one? Ore customer can peck all of them at once? – focus.style Jul 13 '20 at 17:42
  • For Live price update you can try https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=28909#:~:text=Update%20option%20price-,Live%20Price%20Update%20%2F%20Update%20option%20price,of%20currency%20or%20option%20names. – focus.style Jul 13 '20 at 17:43
  • Customer can pick all of them at once based on their choices.... I used this extension, but it is not showing in the module after installed. Will it support 3.0? – Yoonus Jul 15 '20 at 07:00
  • look. Just create 3 separate products. Options is not for that you are tying you use them. Options are some additional options of the current product, not the separate products. Use it in proper way. If the answer was useful (the big answer above) - don't forget to upvote it and mark as accepted. And use options in proper way. – focus.style Jul 15 '20 at 09:19
  • Hi, Yes. I tried with the radio button at last. Thanks dear.. – Yoonus Jul 16 '20 at 18:57