Quote Originally Posted by DrByte View Post
To pass modifications via the URL (or your ajax thing or whatever) you'll need to pass a get or post value which you then use to modify the price in those two classes.
I changed this:

$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);

to this:

$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_draw_hidden_field('g_ad', (int)$_GET['1']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);

in tpl_product_info_display.php

I then went to includes/classes/shopping_cart.php and replaced the relevant instances of

$products_price = $products->fields['products_price'];

with

if($_POST['g_ad'] == '1') {
$products_price = $products->fields['products_price_offer'];
}else{
$products_price = $products->fields['products_price'];
}

but i still get the normal price displaying in the cart.

I assume $_POST['g_ad'] isn't showing as '1'

Any suggestions where i'm going wrong? Do i need to do anything else with g_ad to get it to work?

Thanks
Steve