Er zijn veel verschillende checkouts beschikbaar voor Magento, waaronder Firecheckout. Standaard is er geen ondersteuning voor deze checkout i.c.m. de PostNL extensie, maar vanuit Firecheckout waren ze zo aardig om een paar aanpassingen te maken zodat de extensies toch kunnen samenwerken. Wij kunnen zelf echter geen ondersteuning bieden op deze aanpassingen, daarvoor zal contact opgenomen moeten worden met Firecheckout. Wij raden wel aan om alles eerst te testen op een test/staging omgeving.

  1. Open app/code/community/TIG/PostNL/Model/DeliveryOptions/Observer/ShippingMethodAvailable.php and find the following code:

    if (Mage::app()->getRequest()->getModuleName() == 'onestepcheckout') {
        $template = 'TIG/PostNL/delivery_options/onestepcheckout/available.phtml';
    
        if (!$block->getChild('postnl.osc.delivery.options')) {
            $block = $this->_addDeliveryOptionBlocks($block);
        }
    }

    replace with:

    if (Mage::app()->getRequest()->getModuleName() == 'onestepcheckout') {
        $template = 'TIG/PostNL/delivery_options/onestepcheckout/available.phtml';
    
        if (!$block->getChild('postnl.osc.delivery.options')) {
            $block = $this->_addDeliveryOptionBlocks($block);
        }
    } else if (Mage::app()->getRequest()->getModuleName() == 'firecheckout') {
        $template = 'tm/firecheckout/checkout/shipping_method/available.phtml';
    }
  2. Open skin/frontend/base/default/js/TIG/PostNL/postcodecheck.js and find the following line:

    document.fire('postnl:postcodeCheckSuccess');

    replace with:

    document.fire('postnl:postcodeCheckSuccess', {
        addressType: addressType
    });
  3. Open app/design/frontend/base/default/template/TIG/PostNL/payment/checkout/form/cod.phtml and find the following lines:

    payment.init = function () {
    ...
    }

    Wrap the method into if ('undefined' === typeof FireCheckout) {:

    if ('undefined' === typeof FireCheckout) {
        payment.init = function () {
        ...
        }
    }

    Find the following code:

    if (postnlCodPaymentMethod && typeof deliveryOptions) {
    

    Replace it with:

    if ('undefined' !== typeof postnlCodPaymentMethod && 'undefined' !== typeof deliveryOptions) {
    

    Find the following code:

    if (deliveryOptions && deliveryOptions.options.isOsc) {
  4. Open app/design/frontend/base/default/template/TIG/PostNL/delivery_options/addphonenumber.phtml and find the following line:

    window.deliveryOptions.saveOscOptions();

    Replace it with:

    window.deliveryOptions.saveSelectedOption();
    // window.deliveryOptions.saveOscOptions();
  5. Open app/code/community/TIG/PostNL/etc/config.xml and find the following lines:

    <controller_action_postdispatch_checkout_onepage_saveShippingMethod>
        <observers>
            <!-- Saves selected PostNL options for Onepage checkout. -->
            <checkout_shipping_method_save_options>
                <type>singleton</type>
                <class>postnl_deliveryoptions/observer_updatePostnlOrder</class>
                <method>saveOptions</method>
            </checkout_shipping_method_save_options>
        </observers>
    </controller_action_postdispatch_checkout_onepage_saveShippingMethod>

    Replace it with:

    <controller_action_postdispatch_checkout_onepage_saveShippingMethod>
        <observers>
            <!-- Saves selected PostNL options for Onepage checkout. -->
            <checkout_shipping_method_save_options>
                <type>singleton</type>
                <class>postnl_deliveryoptions/observer_updatePostnlOrder</class>
                <method>saveOptions</method>
            </checkout_shipping_method_save_options>
        </observers>
    </controller_action_postdispatch_checkout_onepage_saveShippingMethod>
    <controller_action_predispatch_firecheckout_index_saveOrder>
        <observers>
            <checkout_shipping_method_save_options>
                <type>singleton</type>
                <class>postnl_deliveryoptions/observer_updatePostnlOrder</class>
                <method>saveOptions</method>
            </checkout_shipping_method_save_options>
        </observers>
    </controller_action_predispatch_firecheckout_index_saveOrder>
  6. Save the files and clear the cache.

Bron: http://docs.swissuplabs.com/m1/extensions/firecheckout/supported-modules/tig-postnl/

  • No labels