Zen Cart Logo
Forums / Bug Reports / No price in product listing

No price in product listing

Locked

Views: 4,727

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
26 Dec 2007, 1:56 PM
#1
sanji avatar

sanji

Zen Follower

Join Date:
Jan 2005
Posts:
138
Plugin Contributions:
0

No price in product listing

This bug concerns the product listing in the admin part of the shop.

If the following settings are selected :
Customer Shop Status - View Shop and Prices 1
Customer Approval Status - Authorization Pending 1

Then in the categories.php file, under the Price/Special/Sale column, no price at all is displayed - the column is empty, apart for the header.

This bug was present since at least ZC 1.3.1, and is still here in ZC 1.3.8a. I just could identify the settings causing problems, so I only report it now.

This error was checked on a freshly installed cart, too.

Thanks,

sanji

26 Dec 2007, 3:41 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

How exactly do you want this to work ...

26 Dec 2007, 10:20 PM
#3
sanji avatar

sanji

Zen Follower

Join Date:
Jan 2005
Posts:
138
Plugin Contributions:
0

Re: No price in product listing

Let's try on demo.opensourcecms.com/zencart/admin/login.php !

In http://demo.opensourcecms.com/zencart/admin/categories.php - create a new product, anything, with any price (I called the product "test", put a price of 100 and a quantity of 100).

Now, the category link http://demo.opensourcecms.com/zencart/admin/categories.php?cPath=&pID=1 displays the product with its price under the "Price/Special/Sale" column.

Go to Configuration / Customer Details, and change the "Customer Shop Status - View Shop and Prices" value from 0 to 1.

Go back to the category listing http://demo.opensourcecms.com/zencart/admin/categories.php and you will see that the price disappeared.

My best guess is that the zen_get_products_display_price function in functions_prices.php first checks the following

switch (true) {
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
        // customer must be logged in to browse
        return '';
        break;
        case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
        // customer may browse but no prices
        return '';
        break;
        default:
        // proceed normally
        break;
      }

If the function is called from the admin part, then this check should be skipped.

Hope this helps,

sanji

26 Dec 2007, 10:35 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

I have no idea what software you are running but as it lists both OSC and Zen Cart I would assume that this is some custom installation and not Zen Cart v1.3.8a ...
http://www.zen-cart.com/forum/showthread.php?t=81696

It is difficult to diagnose something that is not Zen Cart ...

26 Dec 2007, 10:51 PM
#5
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: No price in product listing

sanji, I was able to duplicate your results with 1.3.8a and confirm the bug.

Customer Shop Status - View Shop and Prices 1 or 2
Categories / Products - Top : Price/Special/Sale show no prices

Customer Shop Status - View Shop and Prices 0 or 3
Categories / Products - Top : Price/Special/Sale shows prices

Didn't try with your second setting though as the first setting seems to be the cause of the problem.

26 Dec 2007, 10:59 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

The setting of 1 and 1 on:

Customer Shop Status - View Shop and Prices 1
Customer Approval Status - Authorization Pending 1

When not logged in (first visit to the site) you are presented with a Login/Create Account ...

Once account is created or you login and are NOT yet Approved you are presented with the Customer Authorization Pending ...

Once Approved ... you are presented with a NORMAL shop ...

This is how this is intended to work for these 2 settings when both are set to 1 ...

NOTE: If testing and changing settings and approvals you MUST open a new browser window to ensure a NEW session as the settings as a NEW customer are set on a per session basis ... once set you either need to ensure a NEW session to test a change or WAIT for the existing session to expire ...

26 Dec 2007, 11:01 PM
#7
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: No price in product listing

Linda, the problem/bug is on the Admin side.

Admin > Categories > Categories / Products - Top : Price/Special/Sale show no prices

As one is already logged into the Admin, why would settings for Customers affect what the Admin sees in the Admin section?

27 Dec 2007, 12:43 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

Well there is a problem with that ... :eek:

Let me work out the details to fix this ...

27 Dec 2007, 1:26 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

This was originally designed to make the Admin mirror the Catalog ... unfortunately, somebody ... er ... umm ... me ... forgot to finish this section of code so there was an additional switch in place of the customer_id session variable ... :blush:

This can be changed with a quick fix of:

  function zen_get_products_display_price($products_id) {
    global $db, $currencies;

    if (false) {
// 0 = normal shopping
// 1 = Login to shop
// 2 = Can browse but no prices
    // verify display of prices
      switch (true) {
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
        // customer must be logged in to browse
        return '';
        break;
        case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
        // customer may browse but no prices
        return '';
        break;
        default:
        // proceed normally
        break;
      }
    }

// show case only
    if (STORE_STATUS != '0') {
      if (STORE_STATUS == '1') {
        return '';
      }
    }

NOTE: the STORE_STATUS is also there to do the same thing, that if you turn off the prices based on STORE_STATUS then the prices would turn off in the Admin as well ...

Both of these will be fixed in v1.4 with a better arrangement of code ...

27 Dec 2007, 1:26 AM
#10
sanji avatar

sanji

Zen Follower

Join Date:
Jan 2005
Posts:
138
Plugin Contributions:
0

Re: No price in product listing

Thanks Website Rob for confirming that issue.

Indeed, the problem is that the same function is used in the public AND the admin side, and that function starts with a test that obviously is NOT relevant if using this function from the admin side...

sanji

27 Dec 2007, 2:49 PM
#11
ideasgirl avatar

ideasgirl

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,437
Plugin Contributions:
3

Re: No price in product listing

This can be changed with a quick fix of:
To what file please? :unsure:

27 Dec 2007, 4:32 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

This is in the:
/admin/includes/functions/functions_prices.php

NOTE: you only need this if you want to see the prices when your shop is setup for Customer Authorization ...

27 Dec 2007, 11:45 PM
#13
sanji avatar

sanji

Zen Follower

Join Date:
Jan 2005
Posts:
138
Plugin Contributions:
0

Re: No price in product listing

Thanks, this indeed fixed the issue.

sanji

27 Dec 2007, 11:47 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

It makes for a good temporary work around for now ...

Would of been better with a switch on that section ... silly, silly me ... :rolleyes:

28 Dec 2007, 12:10 AM
#15
sanji avatar

sanji

Zen Follower

Join Date:
Jan 2005
Posts:
138
Plugin Contributions:
0

Re: No price in product listing

Still, considering that this function is both in the admin and catalogue part of the site, why put any switch at all in the admin part? I guess there is no reason to prevent someone calling the function in the admin part of the site to have the price displayed...

sanji

28 Dec 2007, 12:19 AM
#16
ajeh avatar

ajeh

Oba-san

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

Re: No price in product listing

Truth be told ... that function was never finished and was supposed to have a switch so that the listing displayed the same as the shop based on various configurations so you could see the same prices that the customer did ...

Unfortunately, I never finished the changes to it ... :wacko:

So there is a moofy function in the admin ...

Such is the life of an elf ... :lamo: