Hi all,
Im looking for a way to use a banned/block word list for a product option input.
I make custom printed shirts, caps, cups and one of the options is the customer can input a name or phrase.
What I would like to do is stop them inputting words or phrases, this would be in the form of a list of words that is compared against the customers text input.
Is there an extension or something available.
Cheers
Phil
Im looking for a way to use a banned/block word list for a product option input.
I make custom printed shirts, caps, cups and one of the options is the customer can input a name or phrase.
What I would like to do is stop them inputting words or phrases, this would be in the form of a list of words that is compared against the customers text input.
Is there an extension or something available.
Cheers
Phil
Last edited by hudds-phil on Sat Jul 16, 2016 6:03 pm, edited 1 time in total.
You could post a request in the Commercial Support part of this forum.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Little something to start with:
Edit catalog/controller/checkout/cart.php
Search for:
After that add:
Edit catalog/controller/checkout/cart.php
Search for:
Code: Select all
foreach ($product_options as $product_option) {
Code: Select all
if ($product_option['type'] == 'textarea') {
$badwords = array('badword','another_badword','as_many_as_you_like');
foreach ($badwords as $badword) {
if (stristr($option[$product_option['product_option_id']], $badword) > '') {
$json['error']['option'][$product_option['product_option_id']] = $product_option['name'] . ': '. $badword . ' not allowed!';
}
}
}
That is an excellent little snippet of code pprmkrpprmkr wrote:Little something to start with:
Edit catalog/controller/checkout/cart.php
Search for:After that add:Code: Select all
foreach ($product_options as $product_option) {
Code: Select all
if ($product_option['type'] == 'textarea') { $badwords = array('badword','another_badword','as_many_as_you_like'); foreach ($badwords as $badword) { if (stristr($option[$product_option['product_option_id']], $badword) > '') { $json['error']['option'][$product_option['product_option_id']] = $product_option['name'] . ': '. $badword . ' not allowed!'; } } }
Who is online
Users browsing this forum: Google [Bot] and 57 guests