Jump to content

How to get data from the DB?


noesac

Recommended Posts

I want to retrieve the location from the database so I can add the following bit of code to my shopping cart:


IF location = "xx"


PO box addresses are not accepted, please enter a standard mailing address


ELSE 


regular text



How can I retrieve this location data?

Link to comment
Share on other sites

I think you may be a little confused by the ps_product.location value. This is not the location of the customer. It is supposed to be used for locating the product in a warehouse.

I think what you are needing is the customer's location, correct? If so, you can access that through the variables $smarty.post.address1,
$smarty.post.address2, $smarty.post.postcode, and $smarty.post.city.

Link to comment
Share on other sites

No I'm after the location of the product:)

We have two suppliers, and one of them does not deliver to PO Boxes so if any product in the order (e.g. order contains 3 products, but 1 is from this supplier) then we need to show a message that says "Please do not enter a PO Box address!"

Link to comment
Share on other sites

Hum I just tried that, and it doesn't error anymore which means I'm on the right track...but it doesn't actually display the text!

I looked in my database and I can 100% confirm that there is data in the location field, and the spelling is definitely 'supplier1'.

Do I need to specifically retrieve the location field data first?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...