$this->config function doesn't hold the store_id so is there a function the get it from the store's data, Q or Daniel?
The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."
Contact idanlevy for help (see earlier post)...
The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."
Try something like
Code: Select all
<?php echo ($this->config->get('config_store_id') ? $this->config->get('config_store_id') : 'default store'); ?>
Request Reviews v1.0 released.
Very Awesome! Just curious how you knew to do this (I am learning)dbstr wrote:Try something likeCode: Select all
<?php echo ($this->config->get('config_store_id') ? $this->config->get('config_store_id') : 'default store'); ?>
Miguelito-Its his holiday we have been talking-thx
No I got it and it works perfect, thanks again for that. I unfortunately am having problems with reading zipcodes from my database table though. I have zipcodes and I want to see if they match what the user has on their account.
Inside the database it is stored in a new field like 33333,44444,55555,66666
I cant seem to implode this into an array though. This is what I have come up with and it doesnt work:
$storeid = ($this->config->get('config_store_id') ? $this->config->get('config_store_id') : 'default store'); //Thanks idanlevy and dbstr !!
$entry_postcode =$this->db->query("SELECT postcode FROM " . DB_PREFIX . "store WHERE store_id = $storeid");
$entry_postcode_flattened = implode($entry_postcode,',');
if ( preg_match('/'. $entry_postcode_flattened .'/', $address) )
{} else{ echo '<div class="warning">We currently are not delivering in this area! <br> Please contact us for special requests.</div>';
};
Basically this gets infor from my database and depending on the storeid it compares the fields for that store from what the users address is. If the users address matches anything in the database then it passes, else=fail.
the $address is the typical oc cart address:
blah blah
blah
ertert, District of Columbia 29732
United States
I keep on getting this error "Warning: implode() [function.implode]: Invalid arguments passed "
Inside the database it is stored in a new field like 33333,44444,55555,66666
I cant seem to implode this into an array though. This is what I have come up with and it doesnt work:
$storeid = ($this->config->get('config_store_id') ? $this->config->get('config_store_id') : 'default store'); //Thanks idanlevy and dbstr !!
$entry_postcode =$this->db->query("SELECT postcode FROM " . DB_PREFIX . "store WHERE store_id = $storeid");
$entry_postcode_flattened = implode($entry_postcode,',');
if ( preg_match('/'. $entry_postcode_flattened .'/', $address) )
{} else{ echo '<div class="warning">We currently are not delivering in this area! <br> Please contact us for special requests.</div>';
};
Basically this gets infor from my database and depending on the storeid it compares the fields for that store from what the users address is. If the users address matches anything in the database then it passes, else=fail.
the $address is the typical oc cart address:
blah blah
blah
ertert, District of Columbia 29732
United States
I keep on getting this error "Warning: implode() [function.implode]: Invalid arguments passed "
Who is online
Users browsing this forum: No registered users and 362 guests