I am in need of being able to disable the add to cart buttons, and buy now buttons and quanitity boxes when an item is call for price or replacing it with call for price text, I was looking in my product_listing.php file and found this code
PHP Code:
qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" class="m-wrap"/>' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . '<br /><button type="submit" class="button large">'.BUTTON_IN_CART_ALT.'</button></form></div>';
} else {
$lc_button = '<a class="button large" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . BUTTON_IN_CART_ALT . '</a>';
}
}
and was starting to try to toy with it but am not sure I am on the right track this is what I was thinking but I do not think it is coded correctly and also am not sure if it is in the right file or not
PHP Code:
qty box with add to cart button
if $listing->fields['product_is_call'] == 1 || PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT == '1')
else {
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" class="m-wrap"/>' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . '<br /><button type="submit" class="button large">'.BUTTON_IN_CART_ALT.'</button></form></div>';
} else {
$lc_button = '<a class="button large" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . BUTTON_IN_CART_ALT . '</a>';
}
}
Bookmarks