micheleangle Posted September 15, 2008 Share Posted September 15, 2008 Thanks for your responses - didn't realize anyone had responded. Suhy - I looked at your site and tried plugging in various quantities, but an additional "2 or 4" would add to the quantity I entered. (i.e., entered quantity of 22, checkout displayed 24). I tried clearing quantity and updating, but that didn't work. Do you have it working, or was it just a model? What osCommerce no. did you use and what feature? Quote Link to comment Share on other sites More sharing options...
bekatron Posted September 29, 2008 Share Posted September 29, 2008 (edited) Hello, Â Is it possible to only use the block function? Edited September 29, 2008 by bekatron Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted September 29, 2008 Share Posted September 29, 2008 Is it possible to only use the block function? Don't think I tried it but I can't think of why it shouldn't either. Quote Link to comment Share on other sites More sharing options...
bekatron Posted October 3, 2008 Share Posted October 3, 2008 Can someone please help me in the right direction with that? Quote Link to comment Share on other sites More sharing options...
skunkbad Posted October 4, 2008 Share Posted October 4, 2008 I have only one product, but it comes in different colors which I have set up through the product attributes in the admin controls. I have set a price discount if a person buys more than one of this product, but it only works if the person has selected the same color. I need it to work regardless of color choice. Does anyone have an idea of what I need to do to make this work? Quote No Links To My Website Here! Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 4, 2008 Share Posted October 4, 2008 I have only one product, but it comes in different colors which I have set up through the product attributes in the admin controls. I have set a price discount if a person buys more than one of this product, but it only works if the person has selected the same color. I need it to work regardless of color choice. Does anyone have an idea of what I need to do to make this work? Make a discount category and add the product to that discount category. That is the fastest way. Quote Link to comment Share on other sites More sharing options...
skunkbad Posted October 4, 2008 Share Posted October 4, 2008 Make a discount category and add the product to that discount category. That is the fastest way. Â I have added the product to the discount category, and selected this discount category in the product setup, but the discount is not coming through. Please take a look at "dice" on www.michellibackgammon.com Quote No Links To My Website Here! Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 4, 2008 Share Posted October 4, 2008 I have added the product to the discount category, and selected this discount category in the product setup, but the discount is not coming through. Please take a look at "dice" Obviously something goes wrong. Start with looking at $pfs where the discount categories id is stored by adding something like this in the footer (or wherever). echo '<pre>'; print_r($pfs); Quote Link to comment Share on other sites More sharing options...
skunkbad Posted October 4, 2008 Share Posted October 4, 2008 Obviously something goes wrong. Start with looking at $pfs where the discount categories id is stored by adding something like this in the footer (or wherever). echo '<pre>'; print_r($pfs); Â PriceFormatterStore Object ( [priceFormatterData] => Array ( [5] => Array ( [products_name] => Dice [products_model] => [products_image] => dice.jpg [products_id] => 5 [manufacturers_id] => 0 [products_price] => 12.5000 [products_weight] => 0.25 [products_quantity] => 99999 [products_qty_blocks] => 1 [products_tax_class_id] => 0 [specials_new_products_price] => [discount_categories_id] => 1 [price_breaks] => Array ( [0] => Array ( [products_price] => 10.0000 [products_qty] => 2 ) ) ) ) ) Quote No Links To My Website Here! Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 4, 2008 Share Posted October 4, 2008 PriceFormatterStore Object ( [priceFormatterData] => Array ( [5] => Array ( [discount_categories_id] => 1 [price_breaks] => Array ( [0] => Array ( [products_price] => 10.0000 [products_qty] => 2 So far so good. The actual calculation is done in includes/classes/shopping_cart.php, function calculate(): function calculate() { global $currencies, $languages_id, $pfs; // for qpbpp added: $languages_id, $pfs $this->total = 0; $this->weight = 0; if (!is_array($this->contents)) return 0; // BOF qpbpp $discount_category_quantity = array(); // calculates no of items per discount category in shopping basket foreach ($this->contents as $products_id => $contents_array) { if(tep_not_null($contents_array['discount_categories_id'])) { if (!isset($discount_category_quantity[$contents_array['discount_categories_id']])) { $discount_category_quantity[$contents_array['discount_categories_id']] = $contents_array['qty']; } else { $discount_category_quantity[$contents_array['discount_categories_id']] += $contents_array['qty']; } } } // end foreach $pf = new PriceFormatter; // EOF qpbpp etcetera If you do the same trick echo'ing $discount_category_quantity right before $pf = new PriceFormatter; you should see if the other dice within the same discount category are included. Quote Link to comment Share on other sites More sharing options...
skunkbad Posted October 4, 2008 Share Posted October 4, 2008 So far so good.... If you do the same trick echo'ing $discount_category_quantity right before $pf = new PriceFormatter; you should see if the other dice within the same discount category are included.  This discount_category_quantity array is empty. One thing I noticed too, is that if I print_r($this->contents) before the foreach loop, discount_categories_id is also empty for each item in the shopping cart. Quote No Links To My Website Here! Link to comment Share on other sites More sharing options...
skunkbad Posted October 5, 2008 Share Posted October 5, 2008 It turns out that the manual installation instructions that came in the zip for this contribution were wrong, and it was this that was creating the error.  Check out the instructions for manually editing \catalog\includes\classes\shopping_cart.php  Find (around line 110 [around line 119 in edited file]): if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes); } else { $this->contents[$products_id_string] = array('qty' => (int)$qty); Replace with: // BOF qpbpp if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes, $product_info['discount_categories_id']); } else { $this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $product_info['discount_categories_id']); // EOF qpbpp  I decided to take a look at the \catalog\includes\classes\shopping_cart.php that came with the zip, and noticed that this file was different in respect to this code replacement. This is the way it should be:  // BOF qpbpp if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes, $discount_category); } else { $this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $discount_category); // EOF qpbpp  Once I made this switch, everything works perfectly. Quote No Links To My Website Here! Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 5, 2008 Share Posted October 5, 2008 It turns out that the manual installation instructions that came in the zip for this contribution were wrong, and it was this that was creating the error. You are obviously working on Windows because of the way you write the separators between directories with backslashes instead of slashes. The code is exactly the same but the browser or program you use to copy and paste instructions from ignores the Unix line feeds. As you might know Windows uses a kind of double line feed as a line ending (\r\n) where Unix (and Mac OSX, Linux) uses \n. Â Occasionally that is a problem. Notepad is or was a good example. It would show black squares for \n instead of ending the line. Â With text files and using a PHP editor there is no problem (unless you use Notepad of course) because they all recognize a line feed if it is not a Windows one. But HTML instructions are clearer in the separation of instructions and code (plus you can add links inside the document). I noticed recently someone adding the instructions in a text file (add this to...) to his PHP files too and was constantly having errors... Â A basic knowledge of PHP is very, very helpful if you are adding contributions. Quote Link to comment Share on other sites More sharing options...
skunkbad Posted October 5, 2008 Share Posted October 5, 2008 You are obviously working on Windows because of the way you write the separators between directories with backslashes instead of slashes.The code is exactly the same but the browser or program you use to copy and paste instructions from ignores the Unix line feeds. As you might know Windows uses a kind of double line feed as a line ending (\r\n) where Unix (and Mac OSX, Linux) uses \n. Â Occasionally that is a problem. Notepad is or was a good example. It would show black squares for \n instead of ending the line. Â With text files and using a PHP editor there is no problem (unless you use Notepad of course) because they all recognize a line feed if it is not a Windows one. But HTML instructions are clearer in the separation of instructions and code (plus you can add links inside the document). I noticed recently someone adding the instructions in a text file (add this to...) to his PHP files too and was constantly having errors... Â A basic knowledge of PHP is very, very helpful if you are adding contributions. Â I do work on Windows, but the server is Linux. I'm not sure if that matters. All I did was copy and paste your code from the manual install instructions to the existing file. I use Notepad++ for text editing, and the format for this file's line endings is already Unix. It's odd that I could copy and paste all of the code from the manual install instructions, and this is the only part that wouldn't work (considering that the code IS different, and did work after I changed it). If I have this problem, I'm sure other people will too. Â Thanks for your help. Quote No Links To My Website Here! Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 5, 2008 Share Posted October 5, 2008 If I have this problem, I'm sure other people will too. Yes, I have seen it with people using the install instructions for SPPC too but only on one or a few places. I couldn't see anything strange with those parts. Totally stumped about why that happens (sometimes). Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted October 7, 2008 Share Posted October 7, 2008 Hi, Jan: Would you please help to confirm whether this module will support Speical Price product? Now I find it seems not work on my site. Â Best Regards, Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted October 7, 2008 Share Posted October 7, 2008 Hi, Jan:Would you please help to confirm whether this module will support Speical Price product? Now I find it seems not work on my site. Â Best Regards, From PriceFormatter.php have Special Price product process, but my site's specail can't work , I don't setup this special product QPBPP price. Any advice? Â Best Regards, Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted October 7, 2008 Share Posted October 7, 2008 (edited) From PriceFormatter.php have Special Price product process, but my site's specail can't work , I don't setup this special product QPBPP price.Any advice? Â Best Regards, Â Hi Jan: Please ignore it. I find new version have fixed this issue. Â Best Regards, Edited October 7, 2008 by sunrise99 Quote Link to comment Share on other sites More sharing options...
tc001 Posted October 13, 2008 Share Posted October 13, 2008 Hi all! Â I setup this code but need it to work for a swimsuit site - I need this code to work for the same bathing suit style, same bathing suit color but different sizes. Â I read a previous post where a person had a similar request but the response to that was "create a discount category" I didn't understand that. Â Also, would anyone know how to setup the code so the discount amount is displayed during the checkout & the invoice that is e-mailed to the customer? Â Can someone help me? Â Regards, Â Jane Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 13, 2008 Share Posted October 13, 2008 I read a previous post where a person had a similar request but the response to that was "create a discount category" I didn't understand that. admin/discount_categories.php  For this it would actually make more sense to use what was in a previous version of this modification. For a product a discount category of p concatenated with the products_id was always used. For a "real" discount category dc concatenated with the discount category id. Then all products with attributes are automatically grouped for a discount. For that you would need to amend the code in PriceFormatter.php and PriceFormatterStore.php Quote Link to comment Share on other sites More sharing options...
tc001 Posted October 14, 2008 Share Posted October 14, 2008 admin/discount_categories.php For this it would actually make more sense to use what was in a previous version of this modification. For a product a discount category of p concatenated with the products_id was always used. For a "real" discount category dc concatenated with the discount category id. Then all products with attributes are automatically grouped for a discount. For that you would need to amend the code in PriceFormatter.php and PriceFormatterStore.php   Thank you very much for your response, greatly appreciated.  Would you suggest I install the latest files (Quantity Price Breaks Per Product v1.3.5)?  Regards,  Jane Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 14, 2008 Share Posted October 14, 2008 Would you suggest I install the latest files (Quantity Price Breaks Per Product v1.3.5)? Yes. It has proven stable/bug free over the last months. Quote Link to comment Share on other sites More sharing options...
tc001 Posted October 14, 2008 Share Posted October 14, 2008 Yes. It has proven stable/bug free over the last months. Â Thanks for your response. Â Unfortunately I am having too many problems installing this contribution. Â I installed the latest one and soo many error messages were popping up; I then installed version 1_2_3 (it worked) and removed the product sizes and just added a text box in place of it for customers to enter in the size they would like. Â I would have loved to use this contribution but sometimes you don't always get what you want. Â Can you at least point me to the version that contains the files for the discount information to appear in the shopping cart and in the invoice that is e-mailed to the customer and I? Â Thank you again! Â Jane Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted October 14, 2008 Share Posted October 14, 2008 Can you at least point me to the version that contains the files for the discount information to appear in the shopping cart and in the invoice that is e-mailed to the customer and I? There isn't such a version. It is something that you would need to custom code. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 16, 2008 Share Posted October 16, 2008 Hello, Â I just finished installing this contribution, and when I try to go into Catalog I get a parse error: Parse error: syntax error, unexpected $end in... /store/admin/categories.php on line 1896 Â I'm confused because line 1896 is just <!-- body_text_eof //--> Â I'm not sure what to do or how to try to fix this. Can someone help me please? Â TIA Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.