so I've been trying to add a bit of clever coding to my website so I can change the price of products as I'm checking out a customer from my store's computer.
I've been trying to get the displayed product price to become an input field (within some if shop's computer ip address logic)
I've added
$productsPriceEach = zen_draw_input_field('cart_price[]', $products[$i]['price'], 'size="4" class="cart_input_'.$products[$i]['id'].'"');
around line 153 of includes/modules/pages/shopping_cart/header.php
and then I echo that out in the tpl_shopping_cart_default.php
I was trying to add that field to the from submitted
Code:
<form name="cart_quantity" action="http://www.mydomain.com/index.php?main_page=shopping_cart&action=update_product" method="post">
then that action 'update_product'
takes you to...
case 'update_product' :
$_SESSION['cart']->actionUpdateProduct($goto, $parameters);
then in shopping_cart.php function actionUpdateProduct(
I tried to add
$new_price = $_POST['cart_price'][$i]; // new quantity
$new_price = $this->adjust_price($new_price, $_POST['products_id'][$i], 'shopping_cart');
one bracket above
zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
I even copied the logic for function adjust_quantity( to become the function adjust_price. and then commented it mostly out to just return the $new_price.
Now it's late and I think I'm kinda stuck, if anyone has and helpful thoughts on things to echo, I have yet to really see a value I've submitted through the input field. Shouldn't I be able to pull up a print_r($_POST) on this update_quantity function?