Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to create a new extension with observer.</p> <p>For Instance I created extension Jakkor_Setstore. So the folders looked like this:</p> <pre><code>app/code/local/Jakkor app/code/local/Jakkor/Setstore app/code/local/Jakkor/Setstore/etc app/code/local/Jakkor/Setstore/Model </code></pre> <p>In etc there was a file "config.xml":</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;global&gt; &lt;models&gt; &lt;setstoreobserver&gt; &lt;class&gt;Setstore_Model&lt;/class&gt; &lt;/setstoreobserver&gt; &lt;/models&gt; &lt;/global&gt; &lt;frontend&gt; &lt;events&gt; &lt;controller_action_predispatch&gt; &lt;observers&gt; &lt;jakkor_setstore_model_observer&gt; &lt;type&gt;singleton&lt;/type&gt; &lt;class&gt;Jakkor_Setstore_Model_Observer&lt;/class&gt; &lt;method&gt;setstore&lt;/method&gt; &lt;/jakkor_setstore_model_observer&gt; &lt;/observers&gt; &lt;/controller_action_predispatch&gt; &lt;/events&gt; &lt;/frontend&gt; &lt;/config&gt; </code></pre> <p>In Model there is a file "Observer.php":</p> <pre><code>class Jakkor_Setstore_Model_Observer extends Varien_Event_Observer { public function setstore($observer) { if(Mage::getSingleton('customer/session')-&gt;isLoggedIn()) { $groupId = Mage::getSingleton('customer/session')-&gt;getCustomerGroupId(); //get the group id if($groupId == 2) //I don't know what id has your reseller group, so 2 is an example, you need to set here the specific group { Mage::app()-&gt;setCurrentStore(2); //Set id of the store view without vat } else { Mage::app()-&gt;setCurrentStore(1); //set the store view with vat } } } } </code></pre> <p>And of course in app/etc/modules "Jakkor_Setstore.xml":</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Jakkor_Setstore&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/Jakkor_Setstore&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <p>This was tested and it is working. Sorry for the mess before. I didn't test the first approach. I thought that it should work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload