If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Approval Status=3 but can't see 'Out of Stock' icon help please !!

Approval Status=3 but can't see 'Out of Stock' icon help please !!

Locked

Started by oavs on 26 Aug 2010, 10:20 AM · Views: 788

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
26 Aug 2010, 10:20 AM
#1
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Post #1 by oavs

v 1.38a

I have set the shop as 'Customer must be Authorized to shop = 3 (Customer May Browse and May see Prices but Must be Authorized to Buy) .
If you log in, you can see the 'out of stock' icon, but if you don't log in you can't. I can see the prices fine but not the 'out of stock ' icon.

Can some please help to get this icon to show up regardless what settings I select 0-3 in Admin> Customer Details >Customer May Browse and May see Prices but Must be Authorized to Buy

Please

Thank you

Downunder QLD

26 Aug 2010, 2:50 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

In the functions_general.php ... in the function zen_get_buy_now_button ...

The sold out is tested after the approval tests ...

The approval returns you to where it was called from and never checks the sold out status ... so, you never see it ...

You could add an extra button check:

// bof: extra check sold out
    $sold_out_button = '';
    $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

    if ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1') {
      if ($_GET['main_page'] == zen_get_info_page($product_id)) {
        $sold_out_button = '<br />' . zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT);
      } else {
        $sold_out_button = '<br />' . zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT);
      }
    }
// eof: extra check sold out

Above the code:

      switch (true) {
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):

Then, add the variable created:
$sold_out_button

to the return lines of the cases as needed ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

26 Aug 2010, 9:33 PM
#3
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Post #3 by oavs

Gosh, are you trying to make me a coder or something? :-)

Thank you for helping me here for the code, I did find the file in store/includes/functions/ and did find the exact location which is after the line 2115. And thannnnn, I did find the switches as there were 4 of them. To make sure I got it right, I have added in each case :-( like so but I still can not see it.

Have I done it correctly?

  switch (true) {

    case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):

    // customer must be logged in to browse

    $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>';

    return $login_for_price;
    return $sold_out_button ;
    break;

    case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):

    if (TEXT_LOGIN_FOR_PRICE_PRICE == '') {

      // show room only

      return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE;

    } else {

Downunder QLD

26 Aug 2010, 10:48 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

Close ... but put them together:

return $login_for_price . $sold_out_button;

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

26 Aug 2010, 11:15 PM
#5
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Post #5 by oavs

Thank you so much. You are the Queen!

Downunder QLD

27 Aug 2010, 6:59 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #6 by ajeh

You are most welcome ... thanks for the update that this is now working for you to show the Sold Out and the Login for Price ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!