I am usign ajax checkout form and have removed all preselected shipping methods. That means that shipping radio buttons are not checked. I have also put the validation-required class to each radio input and when click complete button, the ajax response correctly returns an error "not shipping method selected....", but the class is not populated with extra "woocommerce-invalid woocommerce-invalid-required-field" so to highlight.
Any suggestions?
Related
I need to have the check out process done by the vendor himself not by the customer and that is how :
I need to make the coupon code mandatory ( to be added by the vendor) so the
"proceed to check out " button is not active unless the coupon code is added, and after the vendor adds the code, the order is completed.
Would recommend the use of javascript to prevent the user from clicking the checkout button.
Each button has a "disabled" state, at which the button is greyed out (by default) and cannot be clicked on (similar to the update cart button when no changes have been made). Simply add the disabled state to the checkout button onLoad, then remove that state when a coupon has been applied (button click event on the apply coupon button).
Currently Im devloping a order page where customer choose the start level and end level, and it would calculate the price because It trigger the "selectindexchange" for the dropdownlist.
The payment method is paypal, which uses the method="post", but whenever I select the level it will just trigger the paypal "buy" button and direct the page to paypal payment page:(
you need to be sure that auto post back property is false for that controls so you require submit button to post it.
Example / Help : autoPostBack
Also use this in page_load
if(!isPostBack){
}
else{
}
which checks the page has load first time or after any post back.
I'm using Website Payments Standard.
I've created 2 Add to Cart buttons using the manager and they work fine.
If my buyer clicks the Continue Shopping button, he's returned to the catalogue page and can't see the cart.
How do I create a View Cart button, please ?
It doesn't appear in the Button factory.
After you create your Add to Cart button, scroll down past the box where PayPal gives you your HTML code. There's a section that says Create more buttons, and one of the options says Create a View Cart button.
i have one form with dozens of components. currently i am not able to use ajax as its showing some error. i want to validation field only for one submit button but as i have more than one submit button it gives error for others as well. whhen i use immediate for other button action of that button not able to access submitted values.
question is there any way to placed validation for particular submit button when having more than one submit button in a form?
Pls can any one help me in this ?
Use required=”#{!empty param[‘frmName:btnSave’]}” this for the fields with btnSave as id of button on which validation is required.
I added a field to a node using hook_form_alter and i can see it fine but now i would like of course that the data enterd in that field is also saved. What do i have to do for this to happen?
When you alter the form, you need to also add a form submission handler to the module; in that way, your module would be invoked when the form is being submitted, and you can save the value of the field you added.
If there are more than one button, then it's preferable to add the submission handler to the specific button you need to act upon. Suppose, for example, that the form has two submission buttons: "Save" and "Delete"; if you add the submission handler with $form[#submit][] = "my module_form_submit"; then the submission handler is called even when the "Delete" button is clicked.
As reported in Form buttons can define custom #submit and #validate handlers:
All forms can have "#validate" and "#submit" properties containing lists of validation and submission handlers to be executed when a user submits data. Previously, if a form featured multiple submission buttons to initiate different actions (updating a record versus deleting, for example), it was necessary to check the incoming $form_values['op'] for the name of the clicked button, then execute different code based on its value.
Now, it is possible to define #validate and #submit properties on each individual form button if desired.
When a specific button is used to submit a form, its validation and submission handlers will be used rather than the default form-level ones. If none are specified at the button level, the form-level handlers will be used instead.
Additionally, The 'op' element in the form values is deprecated and should not be relied upon reports:
As discussed above, each button can have "#validate" and "#submit" functions associated with it. Thus, there should be one button that submits the form and which invokes the normal $form_id_validate and $form_id_submit handlers. Any additional buttons which need to invoke different validate or submit functionality should have button-specific functions. Note also that the 'op' element in the form values, corresponding to the button clicked when there are several in a form in Drupal 5.x, should no longer be relied upon and may not be present.