Custom Price Calculation

Contrib type: 
Module
Status: 
Uploaded for testing
Moderation: 
Not ready for moderation
Latest version: 
1.1

Downloads


Compatibility: 
Ubercart 1.x

The initial idea of this module was to allow custom PHP code to be associated with a product in order to adjust the price of the product. The nature of allowing an admin to enter a block of PHP code to be executed though, allows for much more elaborate and potentially dangerous operations.

Upon installation, this module will add a Custom Code field to your products. Sample uses of this code block are:

$item->price = $item->price;

This will do nothing....but it goes in by default.
$item->price refers to the price before attribute adjustments.

if($item->qty > 5) {
  $item->price = [cost] * 1.1;
}

If more than 5 items are ordered, set the product price to a 10% mark-up of the product cost. Product tokens are exposed to this code so things like [cost], [sell_price], [weight], [weight-raw], etc. can be used.

if(date('j', time()) == '1') {
  $item->price = $item->price/2;
}

Half price on the first of each month.

if($item->qty > 2) {
  $item->qty = 2;
}

An attempt to mimic the max quantity module by setting the quantity to 2 if anything more than 2 is ordered.

There are limitless things to do here, but if you are going to get complicated with it you might as well just write a useful module. This also makes no attempt to notify the customer of any of these adjustments, so you'll need to do so in the description of the product.

v1.0 - 12/27/07 11:00am EST
-Added in some more efficient code as suggested by Ryan for querying and checking data.
-Added in an additional type of token replace for uc_cart_item which is currently being used by the Attribute Tokens module so that when used in combination with that module you can access product attributes in your custom block of code.

v1.1 - 12/27/07 12:00pm EST
-Added 'administer custom code' permission to restrict access to this field

Related threads: 

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Custom Value Calculation

Sweet idea... simple module w/ many users for developers. I'd like to recommend for your consideration the following points:

  • Use drupal_eval() instead of just eval(). There are a few reasons for their wrapper function outlined in that page.
  • I don't really understand the call to token_replace() on the PHP code... that could cause confusion or undesired replacements... and really, since there's no output I don't understand the replacement's necessity.
  • As a hint for your SQL, you can use the following code to trim down your hook_cart_item() and get rid of the default value on the form (i.e. just leave the textfield set to blank if no value was loaded for the node):
    <?php
     
    // Line 22:
     
    $code = db_result(db_query("SELECT custom_code FROM {uc_custom_price} WHERE nid = %d", $item->nid));
      if (!empty(
    $code)) {

     

    // Line 80:
     
    '#default_value' => !empty($node->custom_code) ? $node->custom_code : '',
    ?>
  • Finally, you might consider adding a permission for the module so administrators can restrict who has access to this field. You really want as few people as possible entering PHP on the site, especially as a developer making a site for a client who might enter something horrible. Smiling
cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Re: Custom Value Calculation

Thanks for the suggestions Ryan. Bah...security schmecurity...what possible harm could people do with a block of executed php code? Evil

Regarding the token_replace(), this was my first stab at the token system. My understanding was that in order to allow someone to eval something like...

<?php
if($item->qty > 5) {
 
$item->price = [cost] * 1.1;
}
?>

I'd need to do the token_replace passing it the product object. Is that not how that works?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Re: Re: Custom Value Calculation

I guess since it's a string, it's possible, but someone could do something silly like put in [order-billing-address]. But since it's all PHP and as you show they have to use $item->price anyways (so why not $item->cost?), it's probably best not to mix the replacement possibilities with just knowing the code. Perhaps it would be helpful to create a help page for users with access where you load up the latest created product and print out in a pre block its contents:

<?php
  $output
= '<pre>'. print_r($product, TRUE) .'</pre>';
?>

You could drop this under the help menu for Ubercart and link to it from the product field's description text or something like the tokens do.

Then again, folks messing with PHP should be able to do that themselves. Sticking out tongue

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Re: Re: Re: Custom Value Calculation

Yeah, that example could use $item->cost instead and make more sense. I wanted to put in the token abilities to allow access to attributes not in the $item such as [width] and [width-raw] and such....but more because I wanted to learn a little bit about tokens for my own use. There might also be some obscure applications of using node tokens like [mod-yyyy], but that is a bit of a stretch. 95% off if the product has not been modified for more than 40 years? Puzzled

The help idea and some explanation of available $item properties is a good idea, but I would also hope that anyone messing in this area knows a little about what is going on before they try to use this. I never noticed the Using tokens help screen before, but that is neat.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Re: Custom Value Calculation

I'm not sure if drupal_eval() is exactly what I want. I think I need the undesirable behavior that drupal_eval prevents in order to set $item->price.

Quote:

Using this wrapper also ensures that the PHP code which is evaluated can not overwrite any variables in the calling code, unlike a regular eval() call.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Negative balance

I just started learning PHP and have a Drupal site where I'm trying to setup a small Electronic Components store with Ubercart and I find this module really handy for handling quantity discounts but I was thinking of also using it for something else.

I don't want to accept orders that take the available balance negative so components are on backorder, that implies double shipments and I'm cutting part cost and shipping cost to the bone so I can't afford to double ship.

Would this be a good place also to insert code to check the quantity ordered against stock on hand and modify the quantity if necessary so on hand does not go negative. I would execute this code first then I would follow it with code that calculates discount.

I think this would be a good place but hey what do I know!

Thanks

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
k5nwa, I think you'd be

k5nwa,
I think you'd be better suited looking into the various stock control options available instead of trying to get this module to handle stock for you. I'm not sure you could even do it within this module, but if you could I have to imagine it would be pretty messy and not something that somebody new to PHP and Drupal would want to tackle.

You can try http://www.ubercart.org/contrib/4792 or look through the other available options at...
http://www.ubercart.org/contrib?filter0=**ALL**&filter1=22&filter2=**ALL**

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Stock levels

I was thinking something very simple, it would be just a couple of lines, some if statements to compare the order quantity with available stock, and set the order quantity to the lower of the two.

But I will look at the module, there seems to be some problems with the module when you have different sub-parts derived from the original part.

Thanks

Cecil
k5nwa

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

sphoenixee's picture
Offline
Joined: 06/29/2008
Juice: 16
Re: Custom Price Calculation

Enjoying this module very much. Very helpful for me. Thanks for the good work. .

One problem I come across: When using custom tokens with the Attributes Tokens module, I get errors. For example, if I have custom token called [Hours] (where hours represents number of hours of a service client is buying), and I write

echo [Hours];

I get,
Parse error: syntax error, unexpected ';' in /home/lushlila/public_html/drupal-5.7/sites/all/modules/uc_custom_price1.1/uc_custom_price.module(26) : eval()'d code on line 11

Using

echo [Hours].0;

makes it works fine though.

The error occurs not only with echo, but also with assignment (and probably lots of other things too).

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Access to order total.

First I would like to say that this module is wonderful, I'm just started setting up a store and I setup my parts for have a discount based on quantity ordered and it's working great. I setup 4 levels of discount, the levels and discount vary with the parts and this is perfect. I have a template file with different scenarios that I copy and paste in.

I wanted to try something else, I have parts I give away for the cost of shipping and handling but I want to limit the quantity they can order based on the orders sub-total. I have instructions in the catalog to go shopping for the free parts after they have completed their carts so they get the maximum quantity of freebies.

So can I access from the module the order totals, are they conveniently in a variable somewhere?

Thanks for the assistance and making this module available.

Cecil
k5nwa

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Make it more clear

To make it more clear some sample code;

$balance = uc_payment_balance($order);
if ($balance > 0) {
insert code here to insure that the qty ordered does not exceed my preset limit based on order total
if it does set the item Qty to the maximum allowed under the circumstances
}

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Keep trying but no go

I have tried several things the latest is below where I try to calculate the value of the cart. It's coming up with 0 I think because it doesn't allow any parts to be added. What is typically used so you can debug PHP code on a remote server? I want to single steps and see the content of variables, because right now I',m blind.

$cart_items = uc_cart_get_contents();
$cart_total = 0;
if (!empty($cart_items)) {
foreach ($cart_items as $c_item) {
$cart_total += ($c_item->price) * $c_item->qty;
}
}
$cart_credits = round($cart_total / 3);
if ($item->qty > $cart_credits) {
$item->qty = $cart_credits;
}
$item->price = $item->price;

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
HELP!!!

I have narrowed it down some and this is the problem but I don't know the solution yet.

In the following code snippet the following happens;

$cart_items = uc_cart_get_contents(); // supposed to get all 10 cart items and copy them to $cart_items
$c_count = count($cart_items); // supposed to return 11 including the present item but returns 3 instead.

Lets say I have 10 items in my cart for $100
I then add a free item.
In the cart the item shows up in the 4th position (no rhyme or reason where it puts items, they go all over the place)
the function count shows that there are 3 items in the cart, it though the new entry is the end of the cart.

I think there is a bug in uc_cart_get_contents() it seems to stop transferring when it runs into a product that may not be completely in the cart, it doesn't see that there are more cart entries past product # 3.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: HELP!!!

Cecil, now that you mention it I do recall having problems reliably using uc_cart_get_contents() from within a custom price field. I don't think I was getting anything when I would make that call. I'll look into it a little more and see if I can get to the root of the problem.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Extra detail

I works up to the item that is being entered, and it thinks that that entry is the end of the cart instead on continuing to check for more items.

Thanks

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Extra detail

Cecil, the way this module works doesn't lend itself to what you are trying to accomplish. This module will execute a code snippet as each item is being added to the cart each time the cart is loaded. So when you go to the view cart page, as each item is loaded in the cart each snippet will be run. This is why you are seeing item 4 execute it's code snippet and only show 4 items when you call uc_cart_get_contents(). If you want to see all of the cart contents and their adjusted prices you'd need to query the tables directly and then still do

<?php
     
foreach (module_implements('cart_item') as $module) {
        if(
$module != 'uc_custom_price') {
         
$func = $module .'_cart_item';
         
$func('load', $item);
        }
      }
?>

...since that is how a module like uc_attributes affects the price, and then loop through the items and get a total price. This is a bad idea though and I'm not even sure it would work anyhow.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Extra detail

I will play with that code tonight your little loop is loading $items with the data from the cart, then I can do my thing? Since $item is the variable containing the current cart item, I should use another variable to hold the copy of the entire cart?

I will try it tonight. I'm a little perplexed by a Ubercart behavior, if I go to a different PC, and then look at my cart the items are in different order, should they no be in the same order, it's stored in the database and should it not pull it out the same way every time?

Thanks

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Extra detail

You'll need to grab the items in the cart first via a direct query (which isn't a great idea), then run that code snippet so that you module_invoke modules like the attribute module to get the correct price for each item.

k5nwa's picture
Offline
Joined: 05/25/2008
Juice: 49
Lost in space!

Now you lost me "grab the items in the cart first via a direct query".

Another idea I considered was using workflow-ng event to trigger after the cart was updated and run custom code for the action, but there isn't any way to detect that event, I can trigger on going to checkout but it's a little late then.

I'll think about it (within my limits of knowledge which is minuscule at this point) and see if triggering a workflow-ng event and setting it to execute custom PHP code can be made to be triggered at the right place. But the whole thing boils down to, that when the customer enters too large a quantity of free items I want them to see the correction, before going to checkout but that may not be possible at present.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

Cecil
k5nwa
Blessed are the cracked, for they shall let the light in.

mrfelton's picture
Offline
Joined: 10/03/2008
Juice: 31
Re: Custom Price Calculation

I like the idea of this module, and found myself in need of it for Drupal 6. So I ported it. I'd like to release my Drupal 6 version on Drupal.org, but thought I'd better check with you first. Is there any reason you haven't already released your version on drupal.org? If I set up the project and commit the code to their CVS, would you be willing to become a co-maintainer for the module? I really have no interest in doing any Drupal 5 module development and would be able to offer very little in the way of support and maintanance for Drupal 5... Would you be up for that? If not, do you mind if I go ahead and commit my Drupal 6 code? I can give you credit for the original code.

Tom Kirkpatrick - kirkdesigns.co.uk

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Re: Custom Price Calculation

mrfelton, if you'd like to create this project on drupal.org you are welcome to.

I had refrained from doing so because as time went on I considered this module more and more of a bad idea in general. If an admin knows enough to be using this module they should know enough to be creating their own module to do whatever it is that is being done with uc_custom_price. If an admin doesn't know enough to create a module but knows a little php or can cut and paste a snippet, then it seems dangerous to allow them to do so.

splash112@drupal.org's picture
Offline
Joined: 03/31/2008
Juice: 413
Re: Re: Re: Custom Price Calculation

And the developer who want's to make a new module, but likes a quick and easy proof of concept first? I agree your module is not the best solution, but it helps getting to a better and more permanent solution.

jlaster's picture
Offline
Joined: 03/08/2009
Juice: 22
When does it update price?

Hi,
Great module!
However, it seems to update the price when you add the item to the cart, not when the customer is looking at the item.
Is there a way to show the alternative price all the time, not just at the shopping cart?
Thanks!

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: When does it update price?

That is not currently possible. You can put a feature request up at http://drupal.org/project/issues/uc_custom_price to see if the current maintainer is interested in implementing this sort of functionality.

splash112@drupal.org's picture
Offline
Joined: 03/31/2008
Juice: 413
Re: Re: When does it update price?

I do that basicly by using a modded version of uc_aac.
It's not really an easy way, basicly you will have to change that module quite a lot.

Hope Ubercart 6.x makes this a little easier.

Br
Mark

Ownage's picture
Offline
Joined: 12/19/2008
Juice: 69
Is this going to work for me?

I need a module that allows me to Discount the price of All Items of a Specific Category in the catalog. This discount is based on how many Items were ordered in that category total, not based on just one item. If they order a total of 5 "Boxes" they get a discount per box, doesn't matter if they ordered 1 blue box 1 red box and 3 green boxes.

Hopefully I explained it clearly.

Thanks for your help.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Is this going to work for me?

Ownage: You can do this, but your custom code will need to query tables directly to get the data you are looking for, you will not be able to use uc_cart_get_contents(). At that level of complexity you are probably better off writing your own custom module to do exactly what you want or seeing if existing coupon/discount/fee modules might work for you than trying to use this module.

But yes, it would be possible to do what you are wanting to do with this module.

Ownage's picture
Offline
Joined: 12/19/2008
Juice: 69
Thanks

I wouldn't know where to begin, so I'll probably just end up putting a bid in for a custom module for what I need.

Tango's picture
Offline
Joined: 05/18/2009
Juice: 2
Re: When does it update price?

I had an unusual request. Dynamically price products based on date (product is not an event).

End date = $1000
End date - 1 week = $800
Endate - 2 weeks = $600
if greater than 3 weeks = $400
...
so on and so forth. Basically, if a products due date (taken off the market)is Aug 30, then the price on Aug 9th is $600, Aug 16th is $800, etc.

I created a new CCK text field and named it eventdate. This field is referenced twice; once for ec_custom_price field and once for contemplate body.

$node->field_eventdate[0]['value'] expects strtotime format: 30 August 2009

uc_custom_price text box:

<?php
$todaysdate
= time();
$oneweek = 7*24*60*60;
$referencedate = strtotime(check_plain($node->field_eventdate[0]['value']));

$difference = ($todaysdate - $referencedate);
$weeks = abs(ceil($difference / $oneweek));

if(

$weeks == 0){      //aug 23 - 30
 
$item->price = '1000.00'
}elseif(
$weeks == 1){ //aug 16 - 23
 
$item->price = '800.00';
}elseif(
$weeks == 2){ //aug 9 - 16
 
$item->price = '600.00';
}elseif(
$weeks > 3){  //Aug 2
 
$item->price = '400.00';
}else{
$item->price = $item->price;
}
?>

Next, I needed to reflect the dynamic price in the contemplate body/teaser. I disabled price display via Store administration first. Using contemplate, I adjusted the body to include the similar code above:

<?php
if($node->taxonomy[1455]){ // Based on Term ID
 
   
if(check_plain($node->field_ec_eventdate[0]['value'])){ //if eventdate textfield has a value
 
     
$rightnow = time();
     
$oneweek = 7*24*60*60;
     
$referencedate = strtotime($node->field_ec_eventdate[0]['value']);
     
$difference = abs($rightnow - $referencedate);
     
$weeks = abs(ceil($difference / $oneweek));

      if(

$weeks == 0){
 
       
$displaydate = $referencedate;
       
$purchase_text '<h3>Purchase before '.("l, F jS, Y", $displaydate).' for $1000.00</h3>';
 
      }elseif(
$weeks == 1){
 
       
$displaydate = $referencedate - $oneweek;
       
$purchase_text = '<h3>Purchase before '.date("l, F jS, Y", $displaydate).' for $800.00</h3>';
 
      }elseif
//so on and so forth...
     
}else{ //print nothing
     
}

print

$node->body;
print
$purchase_text;
?>

The above prints "Purchase before Sunday, Aug 2nd, 2009 for $400.00". $purchase_text was injected into the Contemplate body.

jazzdrive3's picture
Offline
Joined: 03/29/2009
Juice: 221
Change Price Dynamically on Product Page

As someone else mentioned, it would be great to have the price reflect on the product page.

Here is my situation. Customers need to be able to put the width and height, and we take that and put it in an equation to get the price, and then give them the price on the page.

Can anyone help with this? This module seems like a good start, but I really need some help.

I could do it with javascript and change the page cosmetically very easily. But how to I change the add_to_cart button to reflect this price? Is there a way?

Thanks!

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Change Price Dynamically on Product Page

I should actually be releasing a module this week to do this. I need to add some config options so that it can deprecate the Ubercart Ajax Attribute Calculations module, but once I've done that and finished clean up I will post it at Drupal.org...probably under a name like Ubercart Ajax Price Calculations, or uc_apc.

Olaf Karsten's picture
Offline
Joined: 10/08/2009
Juice: 8
any progress

cYu - i can't find this module you mentioned. Not ready yet, I guess? Is there a flicker of hope, we will get the module in the next time?

cookie's picture
Offline
Joined: 03/14/2010
Juice: 32
Custom Price Image Upload Issue

After installing Custom Price Calculation 5.x-1.0 module on Drupal 5.20 with all required modules for that drupal version I can not upload images for Product.
If I unistall Custom Price then i can upload images if i istall again then i can not etc. etc.

I have problem with this module I am getting pop-up after selecting "Upload" button. Images after submitting the product uploads to the server anyway (existing as a file and on product page) but can not see preview on submitt product form after getting that pop-up:

{ "status": true, "data": "\x3cdiv id=\"field-image-cache-attach-wrapper\"\x3e\x3cfieldset class=\" collapsible\"\x3e\x3clegend\x3eImage\x3c/legend\x3e\x3cdiv class=\"description\"\x3eImages are not saved until the form is submitted.\x3c/div\x3e\x3cdiv class=\"imagefield-edit-image-row clear-block\"\x3e\x3cdiv class=\"imagefield-edit-preview\"\x3e\x3cimg src=\"/fReklamy/files/cookiemonster_1.jpg\" alt=\"\" title=\"\"  width=\"150\" /\x3e\x3c/div\x3e\x3cdiv class=\"imagefield-edit-image-detail\"\x3e\x3cdiv class=\"imagefield-edit-image-flags\"\x3e\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-0-flags-delete-wrapper\"\x3e\n \x3clabel class=\"option\"\x3e\x3cinput type=\"checkbox\" name=\"field_image_cache[0][flags][delete]\" id=\"edit-field-image-cache-0-flags-delete\" value=\"1\"   class=\"form-checkbox\" /\x3e Delete\x3c/label\x3e\n\x3c/div\x3e\n\x3c/div\x3e\x3cdiv class=\"imagefield-edit-image-description\"\x3e\x3cstrong\x3eFilename: \x3c/strong\x3ecookiemonster_1.jpg\x3c/div\x3e\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-0-alt-wrapper\"\x3e\n \x3clabel for=\"edit-field-image-cache-0-alt\"\x3eAlternate text: \x3c/label\x3e\n \x3cinput type=\"text\" maxlength=\"255\" name=\"field_image_cache[0][alt]\" id=\"edit-field-image-cache-0-alt\"  size=\"10\" value=\"\" class=\"form-text\" /\x3e\n \x3cdiv class=\"description\"\x3eThis text will be used by screen readers, search engines, or when the image cannot be loaded.\x3c/div\x3e\n\x3c/div\x3e\n\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-0-title-wrapper\"\x3e\n \x3clabel for=\"edit-field-image-cache-0-title\"\x3eTitle: \x3c/label\x3e\n \x3cinput type=\"text\" maxlength=\"255\" name=\"field_image_cache[0][title]\" id=\"edit-field-image-cache-0-title\"  size=\"10\" value=\"\" class=\"form-text\" /\x3e\n \x3cdiv class=\"description\"\x3eText to be displayed on mouse overs.\x3c/div\x3e\n\x3c/div\x3e\n\x3c/div\x3e\x3c/div\x3e\x3cdiv id=\"field-image-cache-attach-hide\"\x3e\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-upload-wrapper\"\x3e\n \x3clabel for=\"edit-field-image-cache-upload\"\x3eUpload a new image: \x3c/label\x3e\n \x3cinput type=\"file\" name=\"files[field_image_cache_upload]\"  class=\"form-file imagefield imagefield-field_image_cache\" accept=\"\" id=\"edit-field-image-cache-upload\" size=\"60\" /\x3e\n\n\x3c/div\x3e\n\x3cinput type=\"submit\" name=\"cck_imagefield_field_image_cache_op\" id=\"field-image-cache-attach-button\" value=\"Upload\"  class=\"form-submit\" /\x3e\n\x3c/div\x3e\x3c/fieldset\x3e\n\x3c/div\x3e\x3cinput type=\"hidden\" name=\"field_image_cache-attach-url\" id=\"edit-field-image-cache-attach-url\" value=\"http://localhost/fReklamy/imagefield/js\"  class=\"upload\" /\x3e\n\x3cinput type=\"hidden\" name=\"vid\" id=\"edit-vid\" value=\"\"  /\x3e\n\x3cinput type=\"hidden\" name=\"nid\" id=\"edit-nid\" value=\"\"  /\x3e\n\x3cinput type=\"hidden\" name=\"type\" id=\"edit-type\" value=\"obraz\"  /\x3e\n\x3cdiv\x3e\x3ca href=\"/fReklamy/imagefield/js?formfilter_id=imagefield_js\" class=\"active\"\x3eFilter this form\x3c/a\x3e\x3c/div\x3e" }
cookie's picture
Offline
Joined: 03/14/2010
Juice: 32
Re: Custom Price Calculation

i found out what cause this issue.
i modified #default_value' line in uc_custom_price.module and saved module in UTF-8.
If you would like to handle native language characters in module save it as UTF-8 without BOM.

This module handle price change on shopping card.
That would be excellent if it would handle price change on product page (if you using ajax).

Could you point me for creating price change on product page together with this module pls, pls

cookie's picture
Offline
Joined: 03/14/2010
Juice: 32
Re: any progress
cYu - i can't find this module you mentioned. Not ready yet, I guess? Is there a flicker of hope, we will get the module in the next time?

could you point us to that module pls.

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 852
Re: Re: any progress

The 2 branch of uc_aac is what ended up coming out of those efforts.

Unarmed's picture
Offline
Joined: 08/07/2009
Juice: 141
Re: Custom Price Calculation

Hey how would i go about using this module to add a multiplier to the product cost if a certain attribute option is selected?

e.d if someone picks the option red, the product price is multiplier by 2?

Thanks
Salmon

cookie's picture
Offline
Joined: 03/14/2010
Juice: 32
Re: Re: Re: any progress

CYu could you tell if uc_aac can correct price on product node with two attribute combination.
I made post and do not know where to start.
http://www.ubercart.org/forum/support/16395/there_any_solution_ubercart_...

cookie's picture
Offline
Joined: 03/14/2010
Juice: 32
yes you can do that
Hey how would i go about using this module to add a multiplier to the product cost if a certain attribute option is selected?

e.d if someone picks the option red, the product price is multiplier by 2?

Thanks
Salmon

Yes you can do that but this module impact only the price in shopping cart.
I have problem with price change on product node.
look at the link in my post above.