Forums / Templates, Stylesheets, Page Layout / 'Sold out' button instead of price on main page

'Sold out' button instead of price on main page

Locked

Views: 1,053

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
26 Nov 2009, 8:29 AM
#1
wendon avatar

wendon

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

'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.

26 Nov 2009, 11:51 AM
#2
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

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.

$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

  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();
  }
26 Nov 2009, 12:05 PM
#3
lvt_ltd avatar

lvt_ltd

New Zenner

Join Date:
Jun 2009
Posts:
65
Plugin Contributions:
0

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

30 Nov 2009, 2:14 AM
#4
wendon avatar

wendon

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

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..:wacko:

Many thanks in advance again.

14 Jan 2010, 9:53 AM
#5
cool_y2 avatar

cool_y2

New Zenner

Join Date:
Jan 2010
Posts:
3
Plugin Contributions:
0

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

wendon:

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..:wacko:

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.