Page 1 of 14 12311 ... LastLast
Results 1 to 10 of 136
  1. #1
    Join Date
    Jun 2005
    Posts
    25
    Plugin Contributions
    0

    Default Group Pricing Per Item Issue

    I have installed the mod for Group Pricing Per Item. This is exactly what I was looking for.

    All installed well and fine. When I converted an account over to Group A Pricing, the correct pricing appeared on the product info page and the other product listing sites.

    However, the price reverted back to the normal retail price on the shopping cart page. And in the shopping cart sidebox.

    I have made sure all files are properly uploaded. I can't seem to understand what the problem is.

    Has anyone else had this issue and know a fix for it?

    I am using the latest version of zen cart.

    thanks

  2. #2
    Join Date
    Jun 2005
    Posts
    25
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Anyone have a similar issue?

    I previously was using the dual pricing add on when I had v1.2.6 cart.
    When I upgraded, I decided this mod would be better. And I really need to get it working.

    I have looked at the code and cannot figure out why it is wiping out the wholesale price when it gets to the shopping cart page or listing the prices in the shopping cart side box.

  3. #3
    Join Date
    Nov 2004
    Posts
    45
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Quote Originally Posted by gdrudy View Post
    Anyone have a similar issue?

    I previously was using the dual pricing add on when I had v1.2.6 cart.
    When I upgraded, I decided this mod would be better. And I really need to get it working.

    I have looked at the code and cannot figure out why it is wiping out the wholesale price when it gets to the shopping cart page or listing the prices in the shopping cart side box.
    I get the same problem, the unit price in the shopping cart is the new group price but the total in the shopping cart shows retail. However, when I go ahead with the checkout process, everything seems find, the total showing in the payment confirmation page is the right one. It must be a bug somewhere but I can't find it, can anyone provide a bug fix? Thanks

  4. #4
    Join Date
    Mar 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Quote Originally Posted by lennypeng View Post
    I get the same problem, the unit price in the shopping cart is the new group price but the total in the shopping cart shows retail. However, when I go ahead with the checkout process, everything seems find, the total showing in the payment confirmation page is the right one. It must be a bug somewhere but I can't find it, can anyone provide a bug fix? Thanks

    I have a similar problem, except mine shows normal retail price on the product page, then it shows the new price in the shopping cart.

    from what ive gathered from your posts, is its literaly the opposite.

  5. #5
    Join Date
    Apr 2007
    Posts
    3
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    I had the same issue too. I looked at the code and think I found the problem. I am no zen cart guru, far from it in fact; However, there appears to be a problem with the scope of the $customers_group variable. This is used in the calculate function of the shopping_cart.php file. Calculate calls reset() and then proceeds to use the $customer_group variable to decide which price should be used in calculating the total. The problem is that the $customers_group variable is local to the reset() function and is blank by the time calculate() starts using it.

    To fix this I did the following:
    1. Created a global variable at the of shopping_cart.php ($this->customers_group)
    2. Made sure reset() was actually setting the global variable.
    3. Put a one liner in calculate() to set the local customers_group = $this->customers_group.

    Not clean but it works. Not sure if somebody else didn't fix this already, but, figured I would post just the same. Appears to work for me.

  6. #6
    Join Date
    Jun 2006
    Posts
    12
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Quote Originally Posted by codeMonger View Post
    To fix this I did the following:
    1. Created a global variable at the of shopping_cart.php ($this->customers_group)
    2. Made sure reset() was actually setting the global variable.
    3. Put a one liner in calculate() to set the local customers_group = $this->customers_group.
    Really, really bummed to discover this doesn't work correctly. I had the same issues with the displaying the non-discounted prices etc. For those of us that are even further away from being zen gurus could you please elaborate on the specifics of what you did to tweak this. Which "shpping_cart.php" file (in classes?) did you edit and could you please be so kind as to upload an edited version? Thanks so much!

  7. #7
    Join Date
    Apr 2007
    Posts
    3
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Sorry I wasn't specific. I have attached the shopping_cart.php file in zip format. I am using Zen Cart 1.3.7 plus I have added a few other modules, so, be careful with just uploading my shopping_cart.php (in the includes/classes directory) as it may clobber something you have installed different from me. Specifically, here is what I changed:
    1. Lines 63-67 of the file comment and create a global variable called $customers_group. ("var $customers_group;")
    2. Line 221 I make sure that the global customer_group is set when the reset function is called. ("$this->customers_group = $customer_group->fields['group_name'];")
    3. Line 622 sets the customer_group, local to the calculate function, equal to the global variable I created in #1 and set in #2. Definitely cleaner ways to code but I really didn't have time to tinker. ("$customers_group = $this->customers_group;") In essence this saves you from having to change all the lines with $customers_group in them.

    I would recommend copying and pasting the specific lines mentioned into your existing file so that you don't break something else.

    Best of luck!
    Attached Files Attached Files

  8. #8
    Join Date
    Aug 2006
    Location
    London
    Posts
    53
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Quote Originally Posted by TCarter View Post
    I have a similar problem, except mine shows normal retail price on the product page, then it shows the new price in the shopping cart.

    from what ive gathered from your posts, is its literaly the opposite.

    Hiya all,

    Same prob, tried above fix, but didn't fix it.

    Sure must be little bug and someone will find it soon, otherwise excellent little contrib.

    Thanks

  9. #9
    Join Date
    Jun 2006
    Posts
    12
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Quote Originally Posted by codeMonger View Post
    Best of luck!
    thank you codeMonger! No luck needed, that did the trick... very kind of you to upload that!... only now come to find out GPPI doesn't play at all nice with "special pricing" or "salemaker". Really wacked... e.g. displays:

    $196.60 $233.46
    Save: -19% off


    where $196.60 is the group price (strike through in zen cart) and $233.46 (in red) is the "special" price. Calculates a minus percentage! The right price shows up correctly in the shopping cart but this looks really wacky on the products display. It looks like the code in shopping_cart.php is supposed to turn off the special_price when group_price (// exclude group price) is active, but doesn't look like it's working, or I'm not reading it correctly.

  10. #10
    Join Date
    Apr 2007
    Posts
    3
    Plugin Contributions
    0

    Default Re: Group Pricing Per Item Issue

    Yep, I had assumed the code was correct and didn't take the time to look at it in detail. At first glance I would say the problem is the use of $customers_group as a condition in the if statements [if($customers_group) ] Not really safe code. All $customers_group needs is a space character in it to cause problems. There is an assumption made by this condition that the data will never be in error and we all know what happens when we ASSUME. This wasn't a problem when we set the $products_price variable because we explicitly looked for $customers_group == "Group A" etc. and we have no else clause. So, worst case it drops through the if statement with the same price it had originally. I don't have time to tinker today.... but, if you want a quick and dirty fix I would start with the following change

    CHANGE
    // exclude group price
    if(!$customers_group)
    {

    TO THIS
    // exclude group price (SOLUTION A)
    if($products_price != $product->fields['products_price'])
    {

    OR TO THIS
    // exclude group price (SOLUTION B)
    if($customers_group != "Group A" && $customers_group != "Group B" && $customers_group != "Group C" && $customers_group != "Group D" )
    {

    Solution A: should work because we just want to know if we have changed the price. If the price is not the original price don't dork around with special pricing.
    Solution B: should work because we look specifically for "Group A", "Group B" etc. One possible gotcha here -> we never check that $products->fields['products_group_b_price'] != 0. So, we might have a situation where Group A is set but no price was set. That might be goofy as the Group X price might be $0.00. Looks like, worst case, that would lead to a situation where special_price is not used even though we are still, unknowingly, using the original price.

    Looks like there are 5 or 6 places were if(!$customers_group) is used as a condition. May want to look at them all. I will look at it later and post if I don't see your post first. Good Luck!

 

 
Page 1 of 14 12311 ... LastLast

Similar Threads

  1. online group pricing vs group pricing per item working with sale maker
    By giftsandwhatnot in forum Addon Payment Modules
    Replies: 1
    Last Post: 24 Oct 2011, 09:22 AM
  2. Group Pricing (per item) shipping issue
    By giftsandwhatnot in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 19 Aug 2011, 03:56 PM
  3. Group Pricing Per Item - sort products by price issue, suggested code to fix
    By swagmani in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 2 Mar 2011, 04:14 PM
  4. Group Pricing (per Item) Issue
    By daschenbrener in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 8 Jan 2007, 02:42 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR