10 replies [Last post]
rounder13's picture
Offline
Joined: 07/19/2009
Juice: 75
Was this information Helpful?

we offer free shipping on samples (which are attributes) of the actual products we sell.
how do i configure the conditional actions to make this happen?

example: if customer only orders = no shipping charged at all.
example2: if customers orders actual item and samples of another item to ignore the shipping charges for the samples.

UPS has a base rate fee of around 4$+ or so.
anyone know how i would go abouts doing this?

rounder13's picture
Offline
Joined: 07/19/2009
Juice: 75
Re: Free shipping on samples - How to do in ubercart

i figured it out. in case anyone is wondering...

i'll explain with URL's
went to:
admin/store/settings/quotes/methods/weightquote/add
and put in all 0$. saved it as something like "free sample shipping"

then there will be a conditions options and selected "check products attributes" and selected "samples".
saved and voila.

rounder13's picture
Offline
Joined: 07/19/2009
Juice: 75
Re: Free shipping on samples - How to do in ubercart

ok so this actually does not work.
what it's doing is allowing a free option shipphing when a sample gets in the cart mix.

can anyone please help me??

what i'm trying to do is whenever someone adds a sample (which we have set up as a product attribute) in the cart - to pretty much ignore shipping costs on all samples.

what i'm getting is when a sample is in the cart, along with shippable items with weight, it offers them a radio button for free shipping.
anyone?

rounder13's picture
Offline
Joined: 07/19/2009
Juice: 75
Re: Free shipping on samples - How to do in ubercart

ok so i did something that fixes it for the mean time. i think this may be a legit solution (for the time being).

what i did was:

under the standard UPS quote condition when u enable UPS shipping, i made the condition to "if item is an attribute:actual item" to generate quote.

and i made a new 'weight method' with a condition to only generate "0$" shipping quote if all items in the cart are samples, and made another condition with the "AND" operator to negate all items that were "actual items".

ryanschmidt's picture
Offline
Joined: 11/17/2008
Juice: 235
Re: Re: Free shipping on samples - How to do in ubercart

This is exactly what I need. Thank you for taking the time to explain. Unfortunately, I am having a little trouble following your last post. Could you please clarify? THANKS!

All I see is the option "Order has a product with an attribute". Wouldn't this mean that if the user selected 2 shippable products and 1 sample, that they would not be charged shipping because of the 1 product that should not charge for shipping?

ryanschmidt's picture
Offline
Joined: 11/17/2008
Juice: 235
Re: Re: Free shipping on samples - How to do in ubercart

Rounder13, Please help! I've searched everywhere and you seem to be the only one that has a solution for this issue.

I am having a heck of a time trying to get this setup. I have scoured the forums and found several solutions but NONE seem to work correctly. I'm hoping that I am either doing something wrong or that someone will be gracious enough to take a few minutes to help. Unfortunately, I am convinced that something is broken somewhere.

In short, how do I setup ubercart to only charge shipping if certain attribute options are added to the shopping cart?

The issue:
I have 6 attributes and a total of 16 total options. These are going to be pretty static so I'm willing to manually set this all up in CA. I need to provide free shipping (technically they are non-shippable but I don't think there is a way to set that on the option level, which is kinda dumb if you ask me...) for 8 of the options while the other 8 are flat rate shipping based on country. I have the country based charges setup and working just fine. Obviously, if the user adds two shippable products and 1 non-shippable product to their cart it should charge them shipping.

The solutions I've tried that don't work:
Attempt #1. I setup a Domestic and Non-Shippable Product flat rate shipping method. The Domestic would charge a flat rate of $5 per product and the Non-Shippable would charge nothing. My CA would use "Order has product with particular attribute option" and then I would setup 8 conditions with the shippable attribute options OR'ed together in a condition group. I would then do the same thing for the Non-Shippable CA but would negate all the conditions. This results in the Non-Shippable Product shipping method ALWAYS being chosen regardless of what type of product I add to the cart.

Attempt #2. I then tried to use the weight setting for each option to handle the shipping charge. This client does not have a need to use the weight settings so I was going to repurpose it. I set all the options that needed a shipping charge as "1" in their weight field on the options page. The options without shipping stayed at 0 or null. Then using CA I chose "Check an order's total weight". I set the Domestic shipping method CA to quote if the total weight was "equal to or greater than" 1. And then I did the same for the Non-Shippable Product CA only negated it.

In addition to the above issues (both #1 and #2), I receive this error 27 times on the cart page AND on the product page when I go from the cart page to the product page. Refreshing the page normally gets rid of the error but it consistently errors. warning: key() [function.key]: Passed variable is not an array or object in /var/www/sites/all/modules/contrib/ubercart/uc_attribute/uc_attribute.ca.inc on line 47.

rounder13's picture
Offline
Joined: 07/19/2009
Juice: 75
I did print_r($orders); in the uc_cart.pages.inc file
<?php
print_r
($orders); ==

 

stdClass Object
(
    [
order_id] => 15
   
[uid] => 1
   
[order_status] => in_checkout
   
[order_total] => 41.705
   
[product_count] => 2
   
[primary_email] =>
    [
delivery_first_name] =>
    [
delivery_last_name] =>
    [
delivery_phone] =>
    [
delivery_company] =>
    [
delivery_street1] =>
    [
delivery_street2] =>
    [
delivery_city] =>
    [
delivery_zone] =>
    [
delivery_postal_code] =>
    [
delivery_country] =>
    [
billing_first_name] => j
   
[billing_last_name] =>
    [
billing_phone] =>
    [
billing_company] =>
    [
billing_street1] =>
    [
billing_street2] =>
    [
billing_city] =>
    [
billing_zone] => 12
   
[billing_postal_code] => 91406
   
[billing_country] => 840
   
[payment_method] => credit
   
[data] => Array
        (
            [
cc_data] =>
        )

    [

created] => 1288913496
   
[modified] => 1288913496
   
[host] => 24.199.7.214
   
[products] => Array
        (
            [
0] => stdClass Object
               
(
                    [
order_product_id] => 42
                   
[order_id] => 15
                   
[nid] => 395
                   
[title] => 537472
                   
[manufacturer] =>
                    [
model] => 537472
                   
[qty] => 2
                   
[cost] => 0.00000
                   
[price] => 19.00000
                   
[weight] => 1.75
                   
[data] => Array
                        (
                            [
attributes] => Array
                                (
                                    [
Select Product] => Array
                                        (
                                            [
0] => Actual Item
                                       
)

                                )

                            [

shippable] => 1
                           
[module] => uc_product
                       
)

                    [

order_uid] => 1
               
)

        )

    [

payment_details] => Array
        (
            [
cc_number] => 2095
           
[cc_exp_month] => 1
           
[cc_exp_year] => 2010
           
[cc_type] => American Express
       
)

    [

quote] => Array
        (
            [
method] =>
            [
accessorials] =>
            [
rate] => 0.00000
           
[quote_form] =>
        )

    [

line_items] => Array
        (
            [
0] => Array
                (
                    [
line_item_id] => subtotal
                   
[type] => subtotal
                   
[title] => Subtotal
                   
[amount] => 38
                   
[weight] => 0
                   
[data] =>
                )

            [

1] => Array
                (
                    [
line_item_id] => 9
                   
[type] => tax
                   
[title] => California Tax
                   
[amount] => 3.70500
                   
[weight] => 9
                   
[data] => Array
                        (
                            [
tax_id] => 1
                           
[tax_rate] => 0.0975
                           
[taxable_amount] => 38
                           
[tax_jurisdiction] => California Tax
                       
)

                )

        )

)

?>
ryanschmidt's picture
Offline
Joined: 11/17/2008
Juice: 235
Re: I did print_r($orders); in the uc_cart.pages.inc file

I guess I don't follow...

ryanschmidt's picture
Offline
Joined: 11/17/2008
Juice: 235
Re: Free shipping on samples - How to do in ubercart

Rounder13, Please help! I've searched everywhere and you seem to be the only one that has a solution for this issue.

I am having a heck of a time trying to get this setup. I have scoured the forums and found several solutions but NONE seem to work correctly. I'm hoping that I am either doing something wrong or that someone will be gracious enough to take a few minutes to help. Unfortunately, I am convinced that something is broken somewhere.

In short, how do I setup ubercart to only charge shipping if certain attribute options are added to the shopping cart?

The issue:
I have 6 attributes and a total of 16 total options. These are going to be pretty static so I'm willing to manually set this all up in CA. I need to provide free shipping (technically they are non-shippable but I don't think there is a way to set that on the option level, which is kinda dumb if you ask me...) for 8 of the options while the other 8 are flat rate shipping based on country. I have the country based charges setup and working just fine. Obviously, if the user adds two shippable products and 1 non-shippable product to their cart it should charge them shipping.

The solutions I've tried that don't work:
Attempt #1. I setup a Domestic and Non-Shippable Product flat rate shipping method. The Domestic would charge a flat rate of $5 per product and the Non-Shippable would charge nothing. My CA would use "Order has product with particular attribute option" and then I would setup 8 conditions with the shippable attribute options OR'ed together in a condition group. I would then do the same thing for the Non-Shippable CA but would negate all the conditions. This results in the Non-Shippable Product shipping method ALWAYS being chosen regardless of what type of product I add to the cart.

Attempt #2. I then tried to use the weight setting for each option to handle the shipping charge. This client does not have a need to use the weight settings so I was going to repurpose it. I set all the options that needed a shipping charge as "1" in their weight field on the options page. The options without shipping stayed at 0 or null. Then using CA I chose "Check an order's total weight". I set the Domestic shipping method CA to quote if the total weight was "equal to or greater than" 1. And then I did the same for the Non-Shippable Product CA only negated it.

In addition to the above issues (both #1 and #2), I receive this error 27 times on the cart page AND on the product page when I go from the cart page to the product page. Refreshing the page normally gets rid of the error but it consistently errors. warning: key() [function.key]: Passed variable is not an array or object in /var/www/sites/all/modules/contrib/ubercart/uc_attribute/uc_attribute.ca.inc on line 47.

rounder13's picture
Offline
Joined: 07/19/2009
Juice: 75
Re: Re: Free shipping on samples - How to do in ubercart

hey i didn't even know that there were responses to this thread. im at work right now so my time is limited. i only brisked over your post but i think this may help you....

when you set up attributes, the attribute options are RELATIVE to the price or weight of the product itself.

so if you set up the actual product @ $10 and you put -2 in the attribute option then the option will show as 8$.
same goes for weight. 5lbs under the product with -1 in the weight option will produce 4lbs in the cart. -5 will mean there is no weight for the product, but u may run into other issues with that if you use UPS and has a min rate for each package.

ryanschmidt's picture
Offline
Joined: 11/17/2008
Juice: 235
Re: Re: Re: Free shipping on samples - How to do in ubercart

So, theoretically I could setup all shippable products as 1lb and all non-shippable as -1lb and charge $5/lb for shipping in the US?