Post by kilobit » Mon Sep 06, 2010 11:03 am

Hello, is there a way that I can echo the store_id in the payment.tpl file? I am running multistores.
Thanks

New member

Posts

Joined
Mon Aug 23, 2010 6:28 am

Post by Miguelito » Mon Sep 06, 2010 3:02 pm

$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."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm

Post by idanlevy » Mon Sep 06, 2010 6:46 pm

if you still not managed pm me and i will help

New member

Posts

Joined
Mon Aug 16, 2010 1:57 am

Post by kilobit » Wed Sep 08, 2010 8:28 am

So im guessing there is no way to do this??

New member

Posts

Joined
Mon Aug 23, 2010 6:28 am

Post by Miguelito » Wed Sep 08, 2010 2:34 pm

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."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm

Post by dbstr » Wed Sep 08, 2010 8:17 pm

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.


Active Member

Posts

Joined
Sun Aug 30, 2009 12:20 am

Post by kilobit » Thu Sep 09, 2010 6:47 am

dbstr wrote:Try something like

Code: Select all

<?php echo ($this->config->get('config_store_id') ? $this->config->get('config_store_id') : 'default store'); ?>
Very Awesome! Just curious how you knew to do this (I am learning)

Miguelito-Its his holiday we have been talking-thx

New member

Posts

Joined
Mon Aug 23, 2010 6:28 am

Post by idanlevy » Thu Sep 09, 2010 6:54 am

this is what i told you to try but maybe you didnt know
this is when you save config files than you can get them

New member

Posts

Joined
Mon Aug 16, 2010 1:57 am

Post by kilobit » Thu Sep 09, 2010 8:51 am

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 "

New member

Posts

Joined
Mon Aug 23, 2010 6:28 am

Post by craig100 » Tue Mar 29, 2011 8:13 pm

HI,

If I put $test = $this->config->get('config_store_id'); in the controller checkout/payment.php it's always null. How can I read the store_id in a multi-store situation?

OC 1.4.9.3.

Many thanks

Craig

Newbie

Posts

Joined
Mon Feb 28, 2011 7:50 pm

Post by adyled » Fri Oct 21, 2011 8:57 pm

How about echo the store id from cart.tpl? Any help please?

Newbie

Posts

Joined
Fri Oct 21, 2011 4:55 pm
Who is online

Users browsing this forum: No registered users and 362 guests