Jump to content

goodspark

Member
  • Posts

    8
  • Joined

  • Last visited

Everything posted by goodspark

  1. The test I am running is just 10% off the whole basket. Shipping is not taxed. This is on the final step, with all delivery info added.
  2. I am using 5.2.5. I just looked at a fresh install, and it isn't there. Someone else working on our site must have added it. Sorry for the confusion, but the issue is in place on the clean install as well and also on the Cubecart.com demo store. Tax is calculated from the full price, not discounted price.
  3. Anyone? This seems like it is a pretty big accounting issue, and we are looking to resolve it as soon as possible.
  4. When using a coupon code in CC5, the sales tax is being charged at the full retail price of a product instead of the discounted price from a coupon. Shouldn't the tax be charged at the product total price, including discounts? Let's assume sales tax is 5%. For example, if a dress is $50 but a coupon makes it 10% off, the new product price is $45 so the sales tax should be $2.25. Instead, the sales tax calculates at $2.50 (the original, non-couponed price). I found this commented out in the cart class, inside the _applyDiscounts function: // reduce tax value for coupon // $taxdiscount = $this->basket['total_tax']*($data['value']/100); // $this->basket['total_tax'] = $taxdiscount; // $GLOBALS['cart']->set('order_taxes', $taxdiscount); I tried uncommenting it, but it isn't updating the tax amount. Any ideas?
  5. I feel like I am getting close. I have it adding to the basket, but only the first item in the grid. Products page: {foreach from=$option.values item=value} <input type="text" size="2" {if $value.stock_level == 0 && $value.matrix == 1} disabled="disabled" {/if} name="quan[{$value.assign_id}]" /> {$PRODUCT.product_code}{$value.value_name}<input type="hidden" name="productOptions[{$value.assign_id}]" value="{$value.assign_id}" /><input type="hidden" name="optid" value="{$option.option_id}" /> {/foreach} Cart Class: $opts = $_POST['productOptions']; $quans = $_POST['quan']; foreach($quans as $key => $value) { if($quans[$key] > 0){ $masteropt[$_POST['optid']] = $opts[$key]; $this->add((int)$_POST['add'], $masteropt, (int)$quans[$key]); } } Is there a way to see the POST variables that are going to the cart? I'm not sure why it isn't iterating past the first item.
  6. I think the issue is that they key on the array using the admin uses the same key over and over since it is the product id, which is why the version I darted with wasn't working. So I updated to use the option value as the key so that it is unique. Still stuck, but this is where I am at right now. I think I am passing in the options array wrong, but can't figure out why. On the products page: <input type="text" size="2" {if $value.stock_level == 0 && $value.matrix == 1} disabled="disabled" {/if} name="add[{$value.assign_id}][quantity]" /> <input type="hidden" name="add[{$value.assign_id}][product]" value="{$PRODUCT.product_id}" /> <input type="hidden" name="add[{$value.assign_id}][opt]" value="{$option.option_id}" /> This correctly outputs: <input type="text" size="2" name="add[1959][quantity]" /> <input type="hidden" name="add[1959][product]" value="838" /> <input type="hidden" name="add[1959][opt]" value="1" /> On the cart class: if (is_array($_POST['add'])) { foreach ($_POST['add'] as $key => $value) { // adding multiple options at once $optvalue = $key; $optid = $value['opt']; $prodid = $value['product']; $quan = $value['quantity']; if(is_numeric($quan) && $quan > 1) { $quantity = (int)$quan; $this->add((int)$prodid, $options[$optid][$optvalue], $quantity); } On adding to cart, I am getting the "Please select required options before adding to your basket." message, which makes me think the option array isn't formatted correctly. Any help would be hugely appreciated. I'm banging my head against the wall on this one.
  7. Thanks for the quick response. The issue I am running in to is tying multiple quantity boxes to the inputs. I have this on the products page: {foreach from=$option.values item=value} <input type="text" size="2" {if $value.stock_level == 0 && $value.matrix == 1} disabled="disabled" {/if} name="add[{$PRODUCT.product_id}][quantity]" /> {$PRODUCT.product_code} {$value.value_name} <input type="hidden" name="add[{$PRODUCT.product_id}][opts]" value="{$value.assign_id}" /> <input type="hidden" name="productOptions[{$option.option_id}]" value="{$value.assign_id}" /> {/foreach} and then tried this on the cart class if (is_array($_POST['add'])) { foreach ($_POST['add'] as $key => $value) { // Multi-product adding from category page if(is_numeric($value['quantity']) && $value['quantity'] > 1) { $quantity = (int)$value['quantity']; $opts = $value['opts']; } else { $quantity = 1; } if(isset($_POST['productOptions'])){ $this->add((is_numeric($value)) ? $value : $key, $opts, $quantity); } else { $this->add((is_numeric($value)) ? $value : $key, null, $quantity); } } This just added the last option with a quantity of 1 to the cart.
  8. I am looking for a way to create a grid for the product options so that customers can order different quantities of different options with one add to cart. For example, a dress might have a grid that shows: qty box size Small qty box size Medium qty box size Large I found the code in the categories template to add multiple products to the cart (<input type="text" name="add[{$product.product_id}][quantity]" value="1" class="quantity" />) and I found the code where it parses adding multiple items in cart.class.php if (is_array($_POST['add'])) { foreach ($_POST['add'] as $key => $value) { // Multi-product adding from category page if(is_numeric($value['quantity']) && $value['quantity'] > 1) { $quantity = (int)$value['quantity']; } else { $quantity = 1; } $this->add((is_numeric($value)) ? $value : $key, null, $quantity); } } How do I do an add to cart with multiple quantities linked up to multiple options on a single product ID?
×
×
  • Create New...