Bixie Forum

This is the forum for the free Bixie extensions and general questions.
Bixie customers can use the Support Center for their support questions.

You can visit the old forum here.

Video Tutorials

Bixie now provides video tutorials to help you setting up the Bixie VM-Chrono module.

Check out the video tutorials here for a step-by-step installation help!

Welcome, Guest
Please Login or Register.    Lost Password?

Adjusting prices with your chronoform
(1 viewing) (1) Guest
Go to bottomPage: 1234
TOPIC: Adjusting prices with your chronoform
#24
Adjusting prices with your chronoform 1 Year, 10 Months ago  
You can adjust the price of your rpoduct with the values of a pulldown menu in the same way as is possible in VirtueMart.
Make sure you have installed the patch for VitueMart, especially the classfile ps_product.php. If you use VM1.1.4, make sure you allow the user classes. This is done in the “security” tab of the
global VirtueMart configuration. Also see the manual


Just place "|=7.50" or "|+1.00" behind the value of your Chronoform-field. These values are price-adjustment excluding the tax!

As you can see in the demo on Demoproduct, Chronoforms won't let you have different labels in the pulldown, so you have the "|=7"-extension in the pulldown. This can only be changed manually in the formcode. Please note that any changes you made to the form HTML code in the Form edit page will be lost once you save new changes made in the wizard!
malles
malles
Admin
Posts: 206
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/03/18 22:02 By malles.
The administrator has disabled public write access.
Bixie customers can use the Support Center for their support questions.
 
#25
Re: Adjusting prices with your chronoform 1 Year, 10 Months ago  
Is there a way to price adjust if we are not using a pulldown? I for example have a user entered text field that I calculate the price based on length. This is done within the javascript form code section. I need a way to have this price reflected in the cart or somehow tie it into the price adjust code.

I've been looking at the helper.php file for a possibility.

Any ideas?
mowlman
mowlman
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#26
Re: Adjusting prices with your chronoform 1 Year, 10 Months ago  
You can put the "|+3"-suffix behind any value. You can put a hidden input in your form like
Code:

<input type="hidden" name="adjust_price" value="change|=30.35"/>


You can change the value of the field with any javascript in your form.
malles
malles
Admin
Posts: 206
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
Bixie customers can use the Support Center for their support questions.
 
#27
Re: Adjusting prices with your chronoform 1 Year, 10 Months ago  
malles wrote:
You can put the "|+3"-suffix behind any value. You can put a hidden input in your form like
Code:

<input type="hidden" name="adjust_price" value="change|=30.35"/>


You can change the value of the field with any Javascript in your form.



EXCELLENT!

I added the adjust_price hidden field to my HTML form code, updated my database in Chronoforms, then I was able to assign my calculated code to the adjust_price field within my Form Javascript code.
Code:

$('adjust_price').value = "change|=" + $('hidden_price').value;


Thank you very much for your help.
mowlman
mowlman
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#35
Re: Adjusting prices with your chronoform 1 Year, 10 Months ago  
I have my form working after adding
Code:

$('adjust_price').value = "change|=" + $('hidden_price').value;



however, the words "adjust_price" shows in my cart. The actual field is showing my my cart.



I found this hide array within function ValuesfromFormid (helper.php file)

Code:

$hide = array("cf_id", "uid", "recordtime", "ipaddress", "cf_user_id", "formkey");


And added my other hidden fields to it so they do not show up within my cart. However, if I add adjust_price to it, then my cart price is not updated with the adjust_price value. (obviously , since it was hidden)

Is there away to hide the adjust_price" from showing in the cart , while keeping the ability to have it update the price?

mowlman
mowlman
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/03/24 16:03 By mowlman.Reason: Added picture of cart
The administrator has disabled public write access.
 
#39
Re: Adjusting prices with your chronoform 1 Year, 10 Months ago  
There's a way around it, just make a few adjustments in the helper.
First you add the key the the array $hide you mentioned above. It's on line 74.
$hide = array("cf_id", "uid", "recordtime", "ipaddress", "cf_user_id", "formkey", "adjust_price");
Then on line 322 the function ValuesfromFormid is called from within VirtueMart when calculating price. You want your hidden adjustment value shown here! So we add an attribute to the function to tell it we need the value. Make it:
Code:

$formvalues = modBixvmChronoHelper::ValuesfromFormid ( $formid, 1, 'adjust_price' );
Then go to the function on line 61 and add the attribute. Give it an empty default value '', so it won't be missed if called without the parameter.:
Code:

function ValuesfromFormid ( $formid, $object = 0, $showfield = '' ) {


Then add it to the equation on line 77:
Code:

if ( !in_array($key, $hide) && $value != '' || $key == $showfield ) {


You should have 'adjust_price' in the hide array, as you did before.
It is hidden if the parameter showfield is empty (when called from cart-view), and shown when called with the attribute from VM product-class.
I didn't test it, so please let me know if it worked.

Good luck!
Matthijs
malles
malles
Admin
Posts: 206
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/06/19 22:57 By malles.
The administrator has disabled public write access.
Bixie customers can use the Support Center for their support questions.
 
Go to topPage: 1234
Moderators: baf