Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / attributes per final price and not per product

attributes per final price and not per product

Views: 2,015

Results 1 to 20 of 20
1 Sep 2011, 9:12 AM
#1
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

attributes per final price and not per product

How do i set the attributes so i have a $25 (one time) fee for all products in the cart. Lets say i order product A and product B
(10 of each) and if they select the attribute i want to add a $25 on the final price and not $25 for each product.

1 Nov 2011, 8:28 AM
#2
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

Anyone know, i really need this
Maybe you can do it so if you select the attributes on 1 product $25 is added then if you select it on the next product it's free because you have already selected it before but how do you add this?

1 Nov 2011, 2:14 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: attributes per final price and not per product

In the Attributes Controller, on the Attribute that you want the One Time $25.00 charge, did you try filling in for the:
One Time:

25.00

so that it will charge that once per Product, regardless of quantity? :unsure:

1 Nov 2011, 2:29 PM
#4
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

yes but that is per product not per order. The buyer should not pay a one time fee more than once
They should be able to select the attributes more than once but only pay one time.
It's like a bag of candy they select all the candy they want but only pays for 1 bag

1 Nov 2011, 5:07 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: attributes per final price and not per product

So this is just a Fee you want to charge per order separate regardless of what is ordered ...

So I order 1 Product or 27 Products I get this extra charge ... correct? :unsure:

1 Nov 2011, 5:21 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: attributes per final price and not per product

...But apparently only if a certain attribute is also selected. So presumably some orders would not have this fee.

1 Nov 2011, 5:24 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: attributes per final price and not per product

Is it the same options_id and options_value regardless of Product?

1 Nov 2011, 6:01 PM
#8
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

Ajeh:

So this is just a Fee you want to charge per order separate regardless of what is ordered ...

So I order 1 Product or 27 Products I get this extra charge ... correct? :unsure:

Yes if you select that attribute, it does'nt matter if you select it on more products...
Because i will have a geeting that the user can choose with their own text and the printer charge me a one time fee for variable printing

1 Nov 2011, 6:19 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: attributes per final price and not per product

And a customer couldn't order different greetings on different products in one order? Or are you saying your printer will allow multiple different custom greetings for one additional price?

1 Nov 2011, 6:29 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: attributes per final price and not per product

Are you using the Low Order Fee or do you ever plan on using that? :unsure:

If not, you could use that and customize it with the following code in:
/includes/modules/order_total/ot_loworderfee.php

Install it in the Modules ... Order Totals ... and turn on:
Low Order Fee ot_loworderfee.php

and set it to Enable and the amount to: 10000

Then change the code from:

      if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
        switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
          case 'national':
            if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
          case 'international':
            if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
          case 'both':
            $pass = true; break;
          default:
            $pass = false; break;
        }

to read:

      if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
        switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
          case 'national':
            if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
          case 'international':
            if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
          case 'both':
            $pass = true; break;
          default:
            $pass = false; break;
        }

// bof: turn ON for Option ID 1 and Option Value ID 16
        global $cart;
        $cnt_attribute = 0;
        $products = $_SESSION['cart']->get_products();
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
            foreach ($products[$i]['attributes'] as $option => $value) {
              // comment out echo when done testing
              //echo 'I see: ' . $products[$i]['id'] . ' - ' . $option . ' - ' . $value . '<br>';
              if ($option == 1 and $value == 16) {
                $cnt_attribute += 1;
              }
            }
          }
        }
        if ($cnt_attribute > 0) {
          $pass = true;
        } else {
          $pass = false;
        }

// eof: turn ON for Option ID 1 and Option Value ID 16

and just set the correct Option ID (currently set to 1) and Option Value ID (currently set to use 16) ... to your values ...

NOTE: you can then change the language file with your templates and overrides ...

1 Nov 2011, 8:05 PM
#11
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

gjh42:

And a customer couldn't order different greetings on different products in one order? Or are you saying your printer will allow multiple different custom greetings for one additional price?

It's the second one :) i hope this makes sense

2 Nov 2011, 5:58 AM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: attributes per final price and not per product

Then Ajeh's code will work for you. Just adjust the numbers to fit your case.

2 Nov 2011, 8:56 AM
#13
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

Thanks but how do i find the option value id
i have found the option id, it admin it just says "With a greeting and address" Do i have to look in phpmyadmin or?

2 Nov 2011, 9:28 AM
#14
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

Is that in the attributes controller under Catalog. I guess i need to try some more maybe i have missed something, because it's not working right now. Will check the numbers again

2 Nov 2011, 10:16 AM
#15
oberheimer avatar

oberheimer

Zen Follower

Join Date:
Feb 2009
Posts:
108
Plugin Contributions:
0

Re: attributes per final price and not per product

Seems to work now :D
I need to do some testing. I'm so happy :clap:
Thanks alot

2 Nov 2011, 1:31 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: attributes per final price and not per product

Thanks for the update that this is working ... let us know if you run into other issues ... :smile:

5 Apr 2014, 3:17 AM
#17
narata avatar

narata

New Zenner

Join Date:
Mar 2014
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: attributes per final price and not per product

Ajeh:

Are you using the Low Order Fee or do you ever plan on using that? :unsure:

If not, you could use that and customize it with the following code in:
/includes/modules/order_total/ot_loworderfee.php

Install it in the Modules ... Order Totals ... and turn on:
Low Order Fee ot_loworderfee.php

and set it to Enable and the amount to: 10000

Then change the code from:

  if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
    switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
      case 'national':
        if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
      case 'international':
        if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
      case 'both':
        $pass = true; break;
      default:
        $pass = false; break;
    }
> 
> to read:
> ```
      if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
        switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
          case 'national':
            if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
          case 'international':
            if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
          case 'both':
            $pass = true; break;
          default:
            $pass = false; break;
        }

// bof: turn ON for Option ID 1 and Option Value ID 16
        global $cart;
        $cnt_attribute = 0;
        $products = $_SESSION['cart']->get_products();
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
            foreach ($products[$i]['attributes'] as $option => $value) {
              // comment out echo when done testing
              //echo 'I see: ' . $products[$i]['id'] . ' - ' . $option . ' - ' . $value . '<br>';
              if ($option == 1 and $value == 16) {
                $cnt_attribute += 1;
              }
            }
          }
        }
        if ($cnt_attribute > 0) {
          $pass = true;
        } else {
          $pass = false;
        }

// eof: turn ON for Option ID 1 and Option Value ID 16

and just set the correct Option ID (currently set to 1) and Option Value ID (currently set to use 16) ... to your values ...

NOTE: you can then change the language file with your templates and overrides ...

This thread has been a huge help to me. I am currently running version 1.5 using the product attribute grid and a css drop down menu grid. Th problem I'm having is regarding a one time fee. I want to have a one time fee for an option name. However the one time fee increases for each Option value of this option name.

Specifically, the option name has 7 values. And the one time fee starts at 30 and increases by 30 for each option value.

I added this code to my /includes/modules/order_total/ot_loworderfee.php and it works like a charm. My only question is, could it be modified to create additional low order fees for each option value?

Sorry if this doesn't make total sense. But I am very close to figuring this problem out.

Thanks!

5 Apr 2014, 1:13 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: attributes per final price and not per product

Could you type out really, really slowly an example of how you would want this to work on an Order? :lookaroun

Perhaps a URL to your Product(s) that would produce this example order so we can better understand just what you want to happen ...

6 Apr 2014, 3:32 AM
#19
narata avatar

narata

New Zenner

Join Date:
Mar 2014
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: attributes per final price and not per product

Ajeh:

Could you type out really, really slowly an example of how you would want this to work on an Order? :lookaroun

Perhaps a URL to your Product(s) that would produce this example order so we can better understand just what you want to happen ...

Thank you so much for the response! So basically I run a custom apparel company where we provide the item and printing/embroidery services as well. Customers need to choose a product, sizes and colors for an order. But in a lot of cases, one order can consist of many sizes and/or colors of the product. So I have had to come up with a few ways around problems I have encountered.

The process starts with a customer choosing the product (jersey, shirt, pants,etc.)

Then on that product's page, they choose the color(s) and sizes of the item they need. I added the product attribute grid to allow the customer to choose more than one color and/or size at a time. This helps the customer create one "whole" order at a time rather than multiple "parts" of an order.

Below the grid, I have other attributes to add and upload file options. The most important is the "Number of Colors" which has 7 option values. This lets me know how many set ups are required for the order. This set up is a one time fee ($30 per color) and is only dependent on the colors in the design. So a 1 color design is $30, a 2 color design $60, and so on. So an order for 24 shirts with 6 colors is much more expensive per item than 24 shirts with 1 color.

The problem I encounter is that the product attribute grid turns every size option into a different order in the cart. So the one time fee is charged multiple times depending on the specifics of the order. This is a very big problem for me. After a lot of digging through the forums I was about to give up.

But I came across this thread and decided to use the modified low order fee code. It is tied to my Number of Colors option. But the code only lets me reference one option value.

I think this would be a perfect solution for my site if I could reference all 7 of the option values. But I am not familiar with php and all of my attempts to alter the code are not going well. A minor issue would be to change the "low order fee" language to something like "set up fee".

Here is a link to a product. https://bcinstatees.com/store/index.php?main_page=product_info&cPath=308_307&products_id=326&zenid=915ed95e4da846bab2b3a577669ab7dd

You can choose any color/ size combo. The minimum order is 24. But the problem only arises if a customer chooses more than one size in an order, which is very common. This low order fee module would be the finishing touch for me to upgrade my site. Any help would be greatly appreciated.

6 Apr 2014, 6:58 PM
#20
narata avatar

narata

New Zenner

Join Date:
Mar 2014
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: attributes per final price and not per product

However, if there is no solution and I am just wasting my time, please let me know.