Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2008
    Posts
    23
    Plugin Contributions
    0

    Default 'Sold out' button instead of price on main page

    Hello,

    I need advise on how to put sold out button on main page?

    I added new items and someone bought it. The main page show the price..i want it to be a 'sold out' button instead of price. How do i add that..change price to sold out button. I hope i making sense here.

    Thanks in advance.

  2. #2
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: 'Sold out' button instead of price on main page

    You can show a buy now button for all your items in the new product box. And when the product is not available, it shows the sold out button. Is this what you mean?

    The code for to add the buy now button (for the new products page) is:

    In other pages (specials, featured), rename $new_products accordingly.

    Code:
    $buy_now_link = zen_get_buy_now_button($new_products->fields['products_id'],'<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) .'</a>');
    Put it in /includes/modules/new_products.php

    Have a look at the example below:

    In my code lines 67 - 85

    Code:
      while (!$new_products->EOF) {
        $products_price = zen_get_products_display_price($new_products->fields['products_id']);
    	$buy_now_link = zen_get_buy_now_button($new_products->fields['products_id'],'<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) .'</a>');
        if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);
    
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
        'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . '<span class="advertisedPrice">' . $products_price . '</span><br/>' . $buy_now_link,
        'link' => '' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']),
    	'image' => '' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT), 
    	'title' => '' . $new_products->fields['products_name'],
    	'price' => '' . $products_price);
    
        $col ++;
        if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1)) {
          $col = 0;
          $row ++;
        }
        $new_products->MoveNextRandom();
      }

  3. #3
    Join Date
    Jun 2009
    Posts
    80
    Plugin Contributions
    0

    Default Re: 'Sold out' button instead of price on main page

    Do you have it as sold out just set your quantity as 0 in the product edit page.

    there is also an option to set it as 'call for price' in the same page

  4. #4
    Join Date
    Jul 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: 'Sold out' button instead of price on main page

    Thank you so much for the replies guys.

    I meant..like i added a new product and it shows in the main page. Then someone bought it..in the main page..i still have hte item image but only with price. I wanted to add 'sold out' under that price or instead of price, just a 'sold out' button so they know item is sold & no need to fo to product info page.

    I really hope i'm making sense here..

    Many thanks in advance again.

  5. #5
    Join Date
    Jan 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: 'Sold out' button instead of price on main page

    Quote Originally Posted by wendon View Post
    Thank you so much for the replies guys.

    I meant..like i added a new product and it shows in the main page. Then someone bought it..in the main page..i still have hte item image but only with price. I wanted to add 'sold out' under that price or instead of price, just a 'sold out' button so they know item is sold & no need to fo to product info page.

    I really hope i'm making sense here..

    Many thanks in advance again.
    hi, I'm at the similar situation as yours. my main page shows the items with price also, even though the items already sold. How can I change that?
    Thanks.

 

 

Similar Threads

  1. Sold New Products display Sold Out instead of price on index and products_new pages
    By dharma in forum Templates, Stylesheets, Page Layout
    Replies: 36
    Last Post: 1 Jun 2016, 09:29 PM
  2. Gap in product listing between price and 'sold out' button (new thread)
    By Thannaree in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 6 Sep 2012, 11:41 AM
  3. Sold out button only on main page product listings?
    By jt3c in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Jun 2011, 04:14 PM
  4. Add 'SOLD OUT' button to 'NEW' page?
    By hgws in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Oct 2009, 08:37 AM
  5. Gap in product listing between price and 'sold out' button
    By hindley08 in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 29 Jul 2008, 06:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg