0
votes

I have OpenCart v2.3 and I need make customize on product details page.

Explain what I need:

  • The product take price from the admin panel by default.
  • I need add custom price when user click add to cart button.

Explain how OpenCart adds product to cart:

  • When user click on add to cart button, ajaxFunction is called and goes to checkout/cart/add function with all input fields.

  • Inside function add() in cart controller

    $this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id);

And system/library/cart/cart.php contains all functions

How can apply this idea?

1

1 Answers

0
votes

"How can apply this idea?"

With difficulty, because it will affect a lot of parts of the system.

Perhaps you should consider having a second copy of the product with a different price and your code adjusts just the template so that clicking "Add to Cart" actually adds the second product instead.