Newsletter Checkbox extension - Magento

Namestitev / Implementation


Opombe:
1. Pri delovanju Newsletter Checkbox razširitve se lahko pojavi težava in sicer če imate že nameščeno kakšno dodateko / razširitev pri obrazcu za registracijo, se pri teh dveh datotekah pojavi prepisovanje razredov. To pomeni, da ima eden od teh dveh modulov, ki uporabljata isti razred od Magente, višjo prioriteto in posledično samo eden deluje pravilno.

Rešitev:
Ena izmed možnih rešitev je, da ta dva razreda med seboj povežemo, da se ne izključujeta. - v konfiguracijski datoteki config.xml enega izmed teh dveh dodatkov / razširitev je potrebno odstraniti zapis Rewrite, pri drugi datoteki pa mora ta zapis ostati.
Primer Rewrite zapisa:
<checkout>
<rewrite>
<type_onepage>Spletnisistemi_Checkoutnewsletter_Model_Checkout_Type_Onepage</type_onepage>
</rewrite>
</checkout>


2. Težava se lahko pojavi tudi, če se prepisujeta predlogi (checoutnewsletter.xml), saj se vam potem ikonca za Newsletter ne bo pojavila.

Rešitev:
V glavno Magento datoteko katera se uporablja pri obrazcu za registracijo, dodate zapis v vrstico 170 (pred zapisom </ul>):
<?php echo $this->getLayout()->createBlock('checkoutnewsletter/newsletter')->toHtml() ?>

--------------------------------------------------------------------------------------

Notes:
1. Newsletter Checkbox Extension could have a problem in the operation if you have already installed some other module / extension in the registration form, in these case will appear trancription of classes. This means that one of theese two modules, which use the same class of Magenta, has a higher priority and, consequently, only one works properly.
Solution:
The best way to do this is make one of the modules extend the other, then comment out the rewrite on the extension it is extending in the config.xml.
In simple terms: if you have 2 classes A, B rewriting a magento class C, then you change it such that A extends B rather than C. Then you keep the rewrite in the config of A, but remove from the config of B. This is really just OO programming.
You need to remove "Rewrite"just from one module:
<checkout>
<rewrite>
<type_onepage>Spletnisistemi_Checkoutnewsletter_Model_Checkout_Type_Onepage</type_onepage>
</rewrite>
</checkout>

2. Also could problem apears if there are two templates, which overides themselfs (checoutnewsletter.xml) and result is that checkbox for newsletter won't appear.

Solution:
In main Root folder, which one is used for registration form, add this code in line 170 (before </ul>): <?php echo $this->getLayout()->createBlock('checkoutnewsletter/newsletter')->toHtml() ?>


Kontakt / Contact

Spletni sistemi d.o.o. prodaja@spletnisistemi.si, +386 (0)51 387 716