citabriabob Posted January 29, 2021 Share Posted January 29, 2021 Using Estelles Winterflood's All-in-one shipping, I would like to eliminate all shipping prices for two products, as they are membership fees. Thanks you, Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2021 Share Posted January 29, 2021 Would these actually be considered digital products? To make them digital, the product need only have a downloadable document associated with it, either from the File Picker, or a specific URL in the text box below the picker. The document could be a simple text file, image, or PDF, that serves as a membership certificate. Link to comment Share on other sites More sharing options...
citabriabob Posted January 29, 2021 Author Share Posted January 29, 2021 No. The two items are Club Memberships and have no digital content. I thought about faking this, but that might raise more questions... Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2021 Share Posted January 29, 2021 I would think (based on my selling memberships via CC3 in another life) that memberships would have no physical content. Please let us know what it is about these products that you think are causing AIOS to come back with a shipping rate. And is AIOS the only shipping module you are using? Anyway, I would like to solve this. AIOS does not iterate through the order's product list, but will count the number of items and could make rate calculations based on that. Link to comment Share on other sites More sharing options...
citabriabob Posted January 29, 2021 Author Share Posted January 29, 2021 You are right; there is nothing to ship nor download. Still have to have a quantity (1) to do the pricing, so that sets AIOS up for shipping cost. Thanks. Link to comment Share on other sites More sharing options...
bsmither Posted January 30, 2021 Share Posted January 30, 2021 That suggests that you have AIOS set, in the "Show advanced settings", the "Per item component" checkbox. Or, "Total quantity-based rates" in the Main Settings is checked. This could be because there are other products that, for reasons that are necessary to your business model, do require shipping based on how many things are in the order. I'm going through the AIOS code, but in the meantime, maybe this will be of interest: https://www.cubecart.com/extensions/shipping-methods/link-cubecart-products-to-specific-shipping-services-/-modules According to the description, you can assert these two products will use another module - perhaps the Free Shipping module, or the Per Category module - where all other items in the order will use the default shipping module. You should ask the developer of that module for more details. Link to comment Share on other sites More sharing options...
bsmither Posted January 30, 2021 Share Posted January 30, 2021 Do these particular membership products, and only these products, belong to the same category? If so, then in the AIOS shipping file shipping.class.php, near line 46: $this->_item_count = 0; if(isset($this->_basket['contents']) && is_array($this->_basket['contents'])) { foreach ($this->_basket['contents'] as $item) { // XXX May want to exclude digital products from the item count, i.e. // if ($item['digital']) continue; $this->_item_count += $item['quantity']; } } We can use the appropriate line to test if $item['cat_id'] == 6 (or whatever) to skip over counting that item from the items in the cart. Edit: We cannot use 'cat_id' as this detail is not made available in the _basket['contents']. Link to comment Share on other sites More sharing options...
citabriabob Posted February 19, 2021 Author Share Posted February 19, 2021 OK, here is what I added; $this->_item_count = 0; foreach ($this->_basket['contents'] as $item) { // XXX May want to exclude digital products from the item count, i.e. // if ($item['digital']) continue; // RS-Mod 2/19/21 exclude memberships from item count $item['cat_id'] == 4 continue; $this->_item_count += $item['quantity']; } Now it dies when trying to check out. Calls for https, so that isn't the problem... Did I scew up the modification? Never mind; found my error: s/b // RS-Mod 2/19/21 exclude memberships from item count if ($item['cat_id'] == 4) continue; Link to comment Share on other sites More sharing options...
citabriabob Posted February 19, 2021 Author Share Posted February 19, 2021 Still another change: // RS-Mod 2/19/21 exclude memberships from item count if ($item['cat_id'] == 4) {continue;} Not working (still counts category 4 items) Link to comment Share on other sites More sharing options...
citabriabob Posted February 20, 2021 Author Share Posted February 20, 2021 Just thinking: Is the cat_id in the $item at this point? Seems like it's in the product data... Link to comment Share on other sites More sharing options...
bsmither Posted February 20, 2021 Share Posted February 20, 2021 I think I discovered it is not. If not, we will have to put it in, or test for something else. The CubeCart programmers, for reasons that escape me, programmed a number of queries to return an enumerated list of details, as opposed to everything in the record. I'm looking at this closer. Would the target items have a specific Product Code prefix? I suppose they do not have any weight. This is what we have to work with: 'id' => 1 'quantity' => 1 'digital' => 0 'cost_price' => 0 'option_line_price' => 0 'total_price_each' => 6.99 'description' => This is the main copy for the product. 'name' => Test Product 1 'product_code' => TESA31 'product_weight' => 0 'product_width' => 0.0000 'product_height' => 0.0000 'product_depth' => 0.0000 'tax_each' => 'option_absolute_price' => (Earlier, I was using an installation I had modified to put a lot more of the product's details in the basket, from a separate project.) Link to comment Share on other sites More sharing options...
citabriabob Posted February 20, 2021 Author Share Posted February 20, 2021 1 minute ago, bsmither said: thing in Is there a "file layout" for $item? and other strings/arrays? Link to comment Share on other sites More sharing options...
bsmither Posted February 20, 2021 Share Posted February 20, 2021 Please elaborate. What are you thinking of doing? Link to comment Share on other sites More sharing options...
citabriabob Posted February 20, 2021 Author Share Posted February 20, 2021 Just trying to see were all this is going. Used to be a Systems Analyst with Cobol etc. Link to comment Share on other sites More sharing options...
citabriabob Posted February 22, 2021 Author Share Posted February 22, 2021 Very hard for an old procedural programmer to deal with PHP; trying to make sense of all the code. Not trying to build anything new. Thanks. Link to comment Share on other sites More sharing options...
citabriabob Posted February 23, 2021 Author Share Posted February 23, 2021 You are correct. Problem is that the item is counted for AIOS shipping, which is based on total quantities; there are 3 qty ranges and it overprices. Link to comment Share on other sites More sharing options...
citabriabob Posted February 23, 2021 Author Share Posted February 23, 2021 Both products in question begin with "M"; is the product code available in $item? Link to comment Share on other sites More sharing options...
bsmither Posted February 23, 2021 Share Posted February 23, 2021 Yes. But be aware that when using the product's Options Matrix table, there will be the opportunity to create arbitrary product codes. CubeCart automatically creates a product code in this table constructed from the product code of the base product, then appends -##. Perhaps not applicable to your situation, but something to be aware of. Link to comment Share on other sites More sharing options...
citabriabob Posted February 23, 2021 Author Share Posted February 23, 2021 Does this look good? if startsWith($item['product_code'] == "M") continue Link to comment Share on other sites More sharing options...
bsmither Posted February 23, 2021 Share Posted February 23, 2021 if (substr($item['product_code'],0,1) == 'M') continue; The 'startsWith' is expressed as a substring that starts at zero for 1 character. Let's give it a try. Link to comment Share on other sites More sharing options...
citabriabob Posted February 24, 2021 Author Share Posted February 24, 2021 No, still not working. Have to let this sleep while I try to finish the rest of the project and get it online. Thanks for your help. Link to comment Share on other sites More sharing options...
citabriabob Posted February 25, 2021 Author Share Posted February 25, 2021 On 1/29/2021 at 7:50 PM, bsmither said: Do these particular membership products, and only these products, belong to the same category? If so, then in the AIOS shipping file shipping.class.php, near line 46: $this->_item_count = 0; if(isset($this->_basket['contents']) && is_array($this->_basket['contents'])) { foreach ($this->_basket['contents'] as $item) { // XXX May want to exclude digital products from the item count, i.e. // if ($item['digital']) continue; $this->_item_count += $item['quantity']; } } We can use the appropriate line to test if $item['cat_id'] == 6 (or whatever) to skip over counting that item from the items in the cart. Edit: We cannot use 'cat_id' as this detail is not made available in the _basket['contents']. Final (I hope) issue is that having disabled the mailing list in the trailer, there is still a "Subscribe to mailing list" under the Billing Address question on the Basket. When clicked on, the error: "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request." If not clicked, all is normal to checkout. https://typeclubs.org/aac-toc-cc Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.