Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Prevent Shipping To Po Box? Rate Topic   - - - - -

 
  • drillsar
  • Junior Member
  • Members
  • Join Date: 10-Feb 11
  • 77 posts

Posted 03 January 2018 - 02:43 AM #1

In version 2 on cs cart someone did it. Here is link

 

http://forum.cs-cart...-po-box-how-to/

 

I was hoping this version can do it.



 
  • drillsar
  • Junior Member
  • Members
  • Join Date: 10-Feb 11
  • 77 posts

Posted 04 January 2018 - 05:58 AM #2

Magento has it. there has to be away to do it. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17581 posts

Posted 04 January 2018 - 08:37 AM #3

Did you try the mentioned code on 4.x version? It does not look like too complex changes are required to adapt it to the current core.js file


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • drillsar
  • Junior Member
  • Members
  • Join Date: 10-Feb 11
  • 77 posts

Posted 04 January 2018 - 03:35 PM #4

Where is the core js file located? Never mind I found it



 
  • drillsar
  • Junior Member
  • Members
  • Join Date: 10-Feb 11
  • 77 posts

Posted 04 January 2018 - 06:23 PM #5

Ok not sure what the user data is for address. I seen this in profile_info.tpl

 

            <div class="ty-profiles-info__field">{include file="views/profiles/components/profile_fields_info.tpl" fields=$profile_fields.B title=__("billing_address")}</div>

 
This line:
 
if(elm.attr("name") == "user_data[b_address]") {
 
would this be changed to:
if(elm.attr("name") == "profile_fields.B title=__("billing_address")) {
 
What I have so far:
 // Billing address first line
                      if(elm.attr("name") == "user_data[b_address]") {
                       if (lbl.hasClass('cm-required') || $.is.blank(elm.val()) == false) {
                                        if($('#sa').css('display') !== "block") {
                                                if(elm.val().indexOf( 'po box' ) !== -1 || elm.val().indexOf( 'PO Box' ) !== -1 || elm.val().indexOf( 'P.O. $
                                                                this.form_message("Cannot ship to a PO Box", lbl);
                                                                is_ok = false;
                                                                set_mark = true;
                                                }
                                        }
                                }
                        }


                     // Shipping address first line
                     if(elm.attr("name") == "user_data[s_address]") {
                     if (lbl.hasClass('cm-required') || $.is.blank(elm.val()) == false) {
                                                if(elm.val().indexOf( 'po box' ) !== -1 || elm.val().indexOf( 'PO Box' ) !== -1 || elm.val().indexOf( 'P.O. $
                                                                this.form_message("Cannot ship to a PO Box", lbl);
                                                                is_ok = false;
                                                                set_mark = true;
                                                }
                                        }
                                }


 



 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2808 posts

Posted 05 January 2018 - 06:12 AM #6

Where is the core js file located? Never mind I found it

 

Hello!

 

core.js file is located in the js/tygh/ folder.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17581 posts

Posted 05 January 2018 - 07:39 AM #7

 

What I have so far:

 

Does it work as required?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • drillsar
  • Junior Member
  • Members
  • Join Date: 10-Feb 11
  • 77 posts

Posted 05 January 2018 - 01:25 PM #8

What u mean does it work as required? I tried it and does nothing not sure where to put this at in the core is file or maybe do I put it in checkout tpl file