Jump to content

No Shipping price for individual product


citabriabob
 Share

Recommended Posts

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

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

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

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'].

Edited by bsmither
Link to comment
Share on other sites

  • 3 weeks later...

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

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

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? .

Edited by shubharora734
Link to comment
Share on other sites

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

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

Edited by citabriabob
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...