Forums / Templates, Stylesheets, Page Layout / change order price and add to cart

change order price and add to cart

Locked

Started by sneakyp on 22 Aug 2008, 8:02 PM · Views: 1,898

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
22 Aug 2008, 8:02 PM
#1
sneakyp avatar

sneakyp

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

change order price and add to cart

Hi there,
I would like to change the order in which the price and add to cart are displayed - basically reverse the order so that the add to cart is on top of the price.
Looked in the FAQ but with no luck

Thanks

:blink:

22 Aug 2008, 8:13 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: change order price and add to cart

We'll need a link to your site so we can see what template you're using.

22 Aug 2008, 8:16 PM
#3
sneakyp avatar

sneakyp

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

Re: change order price and add to cart

Here is the link
http://www.naturatrading.ca

Thanks

22 Aug 2008, 9:40 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: change order price and add to cart

The standard method will work for you - edit
/includes/templates/your_template/templates/tpl_product_info_display.php and move the code block marked with

<!--bof Product Price block -->

and

<!--eof Product Price block -->

to below

<!--eof Add to Cart Box -->
22 Aug 2008, 11:15 PM
#5
sneakyp avatar

sneakyp

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

Re: change order price and add to cart

I have tried the method below and it seems to make no difference. I have moved the code block in all instances of tpl_product_info_display.php
What am I doing wrong?- Any other ideas?
Thanks

gjh42:

The standard method will work for you - edit
/includes/templates/your_template/templates/tpl_product_info_display.php and move the code block marked with

<!--bof Product Price block -->

and

<!--eof Product Price block -->

to below

<!--eof Add to Cart Box -->
23 Aug 2008, 2:59 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: change order price and add to cart

You have h2#productPrices unstyled and #cartAdd floated right. They can both be at the same level while floating this way, so they do. You need to float them both the same way if you want them vertically aligned. Also, you will need the price to clear right so it goes below #cartAdd instead of right next to it.

In your stylesheet, find and modify or add

h2#productPrices {
float: right;
clear: right;
}

(Tested on your site and works.)

24 Aug 2008, 5:15 PM
#7
sneakyp avatar

sneakyp

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

Re: change order price and add to cart

What I really wanted to change is when a category is listed, and there are products shown, I would like to reverse the add to cart and price - the price is positioned too high so it is confusing to customers.
Thanks for your help!

25 Aug 2008, 7:44 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: change order price and add to cart

Find this section in /includes/modules/your_template/product_listing.php:```php
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;

    // more info in place of buy now
    $lc_button = '';
    if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
      $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
    } else {
      if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
        if (
            // not a hide qty box product
            $listing->fields['products_qty_box_status'] != 0 &&
            // product type can be added to cart
            zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
            &&
            // product is not call for price
            $listing->fields['product_is_call'] == 0
            &&
            // product is in stock or customers may add it to cart anyway
            ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
          $how_many++;
        }
        // hide quantity box
        if ($listing->fields['products_qty_box_status'] == 0) {
          $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
        } else {
          $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
        }
      } else {

// 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(zen_get_info_page($listing->fields['products_id']), 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" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');

    break;

and switch add & price code like this:php
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = '';//$lc_price;//price moved down

    // more info in place of buy now
    $lc_button = '';
    if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
      $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
    } else {
      if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
        if (
            // not a hide qty box product
            $listing->fields['products_qty_box_status'] != 0 &&
            // product type can be added to cart
            zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
            &&
            // product is not call for price
            $listing->fields['product_is_call'] == 0
            &&
            // product is in stock or customers may add it to cart anyway
            ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
          $how_many++;
        }
        // hide quantity box
        if ($listing->fields['products_qty_box_status'] == 0) {
          $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
        } else {
          $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
        }
      } else {

// 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(zen_get_info_page($listing->fields['products_id']), 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" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
$lc_text .= $lc_price;//new location of price
break;