New Zenner
- Join Date:
- Dec 2014
- Location:
- uruguay
- Posts:
- 65
- Plugin Contributions:
- 0
Started by pixel1987 on 5 Jan 2015, 6:52 PM · Views: 2,388
New Zenner
Totally Zenned
Yes. If the attribute being filled in is a Text attribute, it can be forced to be required by selecting the required flag within the attributes controller... See the following FAQs:
http://www.zen-cart.com/content.php?99-how-do-i-add-attributes-to-my-products
and:
http://www.zen-cart.com/content.php?208-ok-when-i-set-a-attribute-to-an-item-like-a-color-that-must-be-specified-and-i-enable-the-required-button-on-the-attribute-it-is-letting-customers-add-items-to-the-cart-without-giving-a-required-attribute-what-could-be-causing-this (The first line applies only for this situation..)
There are other ways as well to do data validation after submitting, but the above should address your immediate concerns/issues.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
New Zenner
thanks for the reply, but served me because this is already created and donot where access it, is when the user is doing the buying asking these mandatory fields I want to add
Totally Zenned
Sorry, I guess I misunderstood the original request/expectation. Thank you for clarifying.
Although it probably is more preferred to put the attribute in the product itself, you could do validation in the header_php.php file that follows (or an observer) to kick back to the previous or designated page... Would check for the post data of the field to validate that it is not blank, and if it is blank to take the action necessary to 1) post a message about the need to enter the data and to return back (forward) to that page..
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Black Belt
If a dropdown of options would work (and it looks like it would) re-working this mod might be easier: http://www.zen-cart.com/downloads.php?do=file&id=90
Oba-san
You could also customize the file:
/includes/modules/pages/checkout_configuration/header_php.php
and add the code in RED:
if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
$_SESSION['comments'] = $_POST['comments'];
[B]// bof: force comment
if (trim($_SESSION['comments']) == '') {
$messageStack->add_session('checkout_payment', 'Please enter order comments before proceeding.', 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// eof: force comment
[/B]
//'checkout_payment_discounts'
//zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
Now, if they try to submit the order on the checkout_confirmation page without a comment, they will be returned to the checkout_payment and they will see a red message telling them to include a comment ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
New Zenner
thank for the reply mc12345678 and stevesh; stevesh I have the version 1.53 that is a module and then lets me add a option value?
pd: products database with this module are removed?
mc12345678 I did not understand your answer
New Zenner
it worked thanks RED, but is possible to make a option value in here?
Black Belt
It appeared from your image that you want the customer to choose from a number of companies the order would be shipped from. If that isn't correct, post again.
New Zenner
that is correct as you say
Totally Zenned
pixel1987:
thank for the reply mc12345678 and stevesh; stevesh I have the version 1.53 that is a module and then lets me add a option value?
pd: products database with this module are removed?mc12345678 I did not understand your answer
stevesh:
If a dropdown of options would work (and it looks like it would) re-working this mod might be easier: http://www.zen-cart.com/downloads.php?do=file&id=90
stevesh:
It appeared from your image that you want the customer to choose from a number of companies the order would be shipped from. If that isn't correct, post again.
pixel1987:
that is correct as you say
Maybe stevesh is in the process of responding, but as a sort of summary of the current discussion:
ZC 1.5.3 is installed, a plugin that offers a way to select from options and work with the result is available through the plugin identified. This feature appears to be what is most desired. The fact that the plugin though indicates that ZC 1.5.1 is the highest compatible version appears to be an issue of "concern". It could be that the plugin is still functional with ZC 1.5.3, might need some minor modification, or (and doubtful) some major modification to be compatible with ZC 1.5.3... One doesn't "know" until the installation is attempted or the plugin is identified as being 1.5.3 compatible...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Totally Zenned
Ajeh:
You could also customize the file:
/includes/modules/pages/checkout_configuration/header_php.phpand add the code in RED:
if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
$_SESSION['comments'] = $_POST['comments'];
[B]// bof: force comment
if (trim($_SESSION['comments']) == '') {
$messageStack->add_session('checkout_payment', 'Please enter order comments before proceeding.', 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// eof: force comment
[/B]
//'checkout_payment_discounts'
//zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
>
> Now, if they try to submit the order on the checkout_confirmation page without a comment, they will be returned to the checkout_payment and they will see a red message telling them to include a comment ...
Thanks ajeh, that was what I was trying to consider although I didn't have the code available/in memory. :)
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Oba-san
You are welcome ... I searched a few old threads and put something together that worked easily with v153/v154, and problem can be adapted for older, though upgrading is a good idea ... :smile:
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Tell staff why this post should be reviewed.