One Step Checkout Compatibility

Extension Name

Idev_OneStepCheckout

Developer

OneStepCheckout

Issue Status

Resolved with modifications.

Problem

The  One Step Checkout extension doesn't implement the base Magento totals rendering functionality, so the final points earned and redeemed information doesn't show up.

In versions later than 2.2, MageRewards catalog discounts are sometimes missing or incorrect. A patch for this was released in MageRewards 1.6.0.4. This patch supports Magento 1.4.2.0 and up. If store prices are set to include tax, some problems may persist in versions of Magento prior to 1.4.2.0.

In some older versions of One Step Checkout (v3.1.9), there is also a re-write on the Quote model which poses an extra conflict with MageRewards.

In the new version of One Step Checkout (v4.0.3) and MageRewards 1.6.0.6, the One Step Checkout page is not loaded and it load the default Magento One Page checkout.

Resolution

To solve, follow these instructions (if you are using latest OSC version 4.5.x please skip steps 1-3):  

1. Open app\code\local\Idev\OneStepCheckout\Block\Summary.php

2. Replace  Mage_Checkout_Block_Onepage_Abstract with Mage_Checkout_Block_Cart_Totals on line 10. 

3. Open app\design\frontend\default\default\template\onestepcheckout\summary.phtml (in newer versions the file is app\design\frontend\ base\default\template\onestepcheckout\summary.phtml) and replace lines 37-66:

<?php foreach($this->getTotals() as $total): ?>
	<tr>
		<td class="title">
			<?php
			$code = $total->getCode();
			if($code == 'subtotal')	{
				$total_name = $this->__('Subtotal');
			}
			elseif($code == 'shipping')	{
				$total_name = $this->__('Shipping');
			}
			elseif($code == 'grand_total')	{
				$total_name = $this->__('Grand total');
			}
			else	{
				$total_name = $total->getTitle();
			}
			echo $total_name; 
			?>
		</td>
		<td class="value">
			<?php echo $this->helper('checkout')->formatPrice($total->getValue()); ?>
		</td>
	</tr>
	<?php endforeach; ?><br>
	

with the following code:

<?php echo $this->renderTotals(); ?>
<?php echo $this->renderTotals('footer'); ?>
	

4. Open app\code\ local\Idev\OneStepCheckout\Model\Sales\Quote.php and replace the following line

class  Idev_OneStepCheckout_Model_Sales_Quote extends Mage_Sales_Model_Quote
	

with

class  Idev_OneStepCheckout_Model_Sales_Quote extends TBT_Rewards_Model_Sales_Quote
	

5.  Only if you modified the file above, edit app\etc\modules\Idev_OneStepCheckout.xml and add in the extra dependency line as demonstrated below:

<config>
    <modules>
        <Idev_OneStepCheckout>
            <active>true</active>
            <codePool>local</codePool>
            <depends>TBT_Rewards</depends>
        </Idev_OneStepCheckout>
    </modules>
</config>
	

For stores running MageRewards 1.7+ and One Step Checkout 4.0.8+, follow these steps to make sure all checking links are redirected to One Step Checkout:

1. Open app\design\frontend\ base\default\template\onestepcheckout\summary.phtml) and replace lines 59-105:

<?php foreach($this->getTotals() as $total): ?>
    <?php if(!$total->getTitle()){continue;}?>
        <?php
        $fullInfo = $total->getFullInfo();
        if(!empty($fullInfo) && $checkoutHelper->settings['display_full_tax']):
            foreach ($fullInfo as $info):
                $rates = current($info['rates']);
                $amount = $info['amount'];
        ?>
            <tr>
                <td class="title"><?php echo $rates['title'] ?> (<?php echo $rates['percent'] ?>%)</td><td class="value"><?php echo $this->helper('checkout')->formatPrice($amount); ?></td>
            </tr>
        <?php endforeach;
        endif;?>
    <tr<?php if($total->getCode() == 'grand_total'): ?> class="grand-total"<?php endif; ?>>
        <td class="title">
            <?php
            $code = $total->getCode();
            $value = $total->getValue();
            if($code == 'subtotal')    {
                $total_name = $this->__('Subtotal');
            }
            elseif($code == 'shipping')    {
                $total_name = $this->__('Shipping');
                if($checkoutHelper->settings['display_tax_included'])   {
                    $value += $this->getQuote()->getShippingAddress()->getShippingTaxAmount();
                }
                            }
            elseif($code == 'grand_total')    {
                $total_name = $this->__('Grand total');
            }
            else    {
                $total_name = $total->getTitle();
            }
            echo $total_name;
            ?>
        </td>
        <td class="value">
            <?php echo $this->helper('checkout')->formatPrice($value); ?>
        </td>
    </tr>
    <?php endforeach; ?>

with

<?php echo $this->renderTotals(); ?> <?php echo $this->renderTotals('footer'); ?>

2. Open app\code\ local\Idev\OneStepCheckout\Model\Sales\Quote.php and replace the following line

class  Idev_OneStepCheckout_Model_Sales_Quote extends Mage_Sales_Model_Quote
	

with

class  Idev_OneStepCheckout_Model_Sales_Quote extends TBT_Rewards_Model_Sales_Quote
	

3.  Only if you modified the file above, edit app\etc\modules\Idev_OneStepCheckout.xml and add in the extra dependency line as demonstrated below:

<config>
    <modules>
        <Idev_OneStepCheckout>
            <active>true</active>
            <codePool>local</codePool>
            <depends>TBT_Rewards</depends>
        </Idev_OneStepCheckout>
    </modules>
</config>
	

For stores running MageRewards 1.6.0.6 and One Step Checkout 4.0.3, follow the steps below to make sure all checkout links are redirected to One Step Checkout:

1. Copy /app/code/ community/TBT/Rewards/Block/Checkout/Onepage/Link.php to /app/code/local/TBT/Rewards/Block/Checkout/Onepage/Link.php so that you are not modifying core extension files.

2. Open app/code/ local/TBT/Rewards/Block/Checkout/Onepage/Link.php, change:

class TBT_Rewards_Block_Checkout_Onepage_Link extends Mage_Checkout_Block_Onepage_Link
	

to

class TBT_Rewards_Block_Checkout_Onepage_Link extends Idev_OneStepCheckout_Block_Checkout_Onepage_Link
	

Additional Steps For MageRewards Platinum users:

1. Copy app/code/community/TBT/RewardsOnly/Block/Checkout/Onepage/Link.php to app/code/local/TBT/RewardsOnly/Block/Checkout/Onepage/Link.php so that you are not modifying core extension files.

2. Open app/code/ local/TBT/RewardsOnly/Block/Checkout/Onepage/Link.php

3. Edit line 46 to be this instead:

class TBT_RewardsOnly_Block_Checkout_Onepage_Link extends Idev_OneStepCheckout_Block_Checkout_Onepage_Link
	

4. Open app/etc/modules/TBT_RewardsOnly.xml

5. Add the following after <TBT_RewardsPlat/> (line 10):

<Idev_OneStepCheckout/>
	

Please keep in mind that implementing any modifications to your MageRewards core code does void your support agreement because you're adding dependency to the other module.

Still need help? Get Help Get Help