1

I am trying to make my wishlist more like a quote/printable quote. I have the wishlist total in addition to subtotals for each line item. The next piece would be adding the shipping estimator to display the shipping options and pricing. Has anyone successfully added the shipping/tax estimator from the cart to the wishlist? How would I achieve this?

app/design/frontend/base/default/template/wishlist/view.phtml

<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <div class="my-wishlist">
        <div class="page-title title-buttons">
            <?php if ($this->helper('wishlist')->isRssAllow() && $this->hasWishlistItems()): ?>
                <a href="<?php echo $this->helper('wishlist')->getRssUrl($this->getWishlistInstance()->getId()); ?>" class="link-rss"><?php echo $this->__('RSS Feed') ?></a>
            <?php endif; ?>
            <h1><?php echo $this->getTitle(); ?></h1>
        </div>
        <?php echo $this->getMessagesBlock()->toHtml() ?>

        <form id="wishlist-view-form" action="<?php echo $this->getUrl('*/*/update', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>" method="post">
            <?php echo $this->getChildHtml('top'); ?>
            <fieldset>
                <?php if ($this->hasWishlistItems()): ?>
                        <?php echo $this->getBlockHtml('formkey');?>
                        <?php $this->getChild('items')->setItems($this->getWishlistItems()); ?>
                        <?php echo $this->getChildHtml('items');?>
                        <script type="text/javascript">decorateTable('wishlist-table')</script>
                <?php else: ?>
                    <p class="wishlist-empty"><?php echo $this->__('You have no items in your wishlist.') ?></p>
                <?php endif ?>
                <div class="buttons-set buttons-set2">
                    <?php echo $this->getChild('control_buttons')->toHtml();?>
                </div>
            </fieldset>
        </form>

        <form id="wishlist-allcart-form" action="<?php echo $this->getUrl('*/*/allcart') ?>" method="post">
            <?php echo $this->getBlockHtml('formkey') ?>
            <div class="no-display">
                <input type="hidden" name="wishlist_id" id="wishlist_id" value="<?php echo $this->getWishlistInstance()->getId() ?>" />
                <input type="hidden" name="qty" id="qty" value="" />
            </div>
        </form>

        <script type="text/javascript">
        //<![CDATA[
            var wishlistForm = new Validation($('wishlist-view-form'));
            var wishlistAllCartForm = new Validation($('wishlist-allcart-form'));

            function calculateQty() {
                var itemQtys = new Array();
                $$('#wishlist-view-form .qty').each(
                    function (input, index) {
                        var idxStr = input.name;
                        var idx = idxStr.replace( /[^\d.]/g, '' );
                        itemQtys[idx] = input.value;
                    }
                );

                $$('#qty')[0].value = JSON.stringify(itemQtys);
            }

            function addAllWItemsToCart() {
                calculateQty();
                wishlistAllCartForm.form.submit();
            }
        //]]>
        </script>
    </div>
    <?php echo $this->getChildHtml('bottom'); ?>
    <div class="buttons-set">
        <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
    </div>
<?php endif ?>

app/design/frontend/base/default/layout/wishlist.xml

<layout version="0.1.0">

<!--
Default layout, loads most of the pages
-->

    <default>
        <reference name="top.links">
            <block type="wishlist/links" name="wishlist_link" />
            <action method="addLinkBlock"><blockName>wishlist_link</blockName></action>
        </reference>

        <!-- Mage_Wishlist -->
        <reference name="right">
            <block type="wishlist/customer_sidebar" name="wishlist_sidebar" as="wishlist" after="cart_sidebar" template="wishlist/sidebar.phtml" />
        </reference>
    </default>

<!--
Customer account pages, rendered for all tabs in dashboard
-->

    <customer_account>
        <!-- Mage_Wishlist -->
        <reference name="customer_account_navigation">
            <action method="addLink" translate="label" module="wishlist" ifconfig="wishlist/general/active"><name>wishlist</name><path>wishlist/</path><label>My Wishlist</label></action>
        </reference>
    </customer_account>

<!--
Customer account home dashboard layout
-->

    <customer_account_index>
        <reference name="right">
            <action method="unsetChild"><name>wishlist</name></action>
        </reference>
    </customer_account_index>

<!--
Wishlist pages
-->

    <wishlist_index_index translate="label">
        <label>Customer My Account My Wishlist</label>
        <!-- Mage_Wishlist -->
        <update handle="customer_account" />
        <reference name="my.account.wrapper">
            <block type="wishlist/customer_wishlist" name="customer.wishlist" template="wishlist/view.phtml">
                <action method="setTitle" translate="title">
                    <title>My Wishlist</title>
                </action>
                <block type="wishlist/customer_wishlist_items" name="customer.wishlist.items" as="items" template="wishlist/item/list.phtml">
                    <block type="wishlist/customer_wishlist_item_column_image" name="customer.wishlist.item.image" template="wishlist/item/column/image.phtml" />
                    <block type="wishlist/customer_wishlist_item_column_comment" name="customer.wishlist.item.info" template="wishlist/item/column/info.phtml">
                        <action method="setTitle" translate="title">
                            <title>Product Details and Comment</title>
                        </action>
                    </block>
                    <block type="wishlist/customer_wishlist_item_column_cart" name="customer.wishlist.item.cart" template="wishlist/item/column/cart.phtml">
                        <action method="setTitle" translate="title">
                            <title>Add to Cart</title>
                        </action>
                        <block type="wishlist/customer_wishlist_item_options" name="customer.wishlist.item.options" />
                    </block>
                    <block type="wishlist/customer_wishlist_item_column_remove" name="customer.wishlist.item.remove" template="wishlist/item/column/remove.phtml" />
                </block>
                <block type="core/text_list" name="customer.wishlist.buttons" as="control_buttons">
                    <block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.share" template="wishlist/button/share.phtml" />
                    <block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.toCart" template="wishlist/button/tocart.phtml" />
                    <block type="wishlist/customer_wishlist_button" name="customer.wishlist.button.update" template="wishlist/button/update.phtml" />
                </block>
            </block>
        </reference>
        <reference name="right">
            <action method="unsetChild"><name>wishlist_customer_sidebar</name></action>
        </reference>
    </wishlist_index_index>

    <wishlist_index_share translate="label">
        <label>Customer My Account Wishlist Sharing Form</label>
        <!-- Mage_Wishlist -->
        <update handle="customer_account" />
        <reference name="my.account.wrapper">
            <block type="wishlist/customer_sharing" name="wishlist.sharing" template="wishlist/sharing.phtml" />
        </reference>
        <reference name="right">
            <action method="unsetChild"><name>wishlist_customer_sidebar</name></action>
        </reference>
    </wishlist_index_share>

    <wishlist_index_configure translate="label">
        <label>Configure Wishlist Item</label>
        <update handle="catalog_product_view" />
        <reference name="product.info">
            <block type="wishlist/item_configure" name="product.info.addto" as="addto" template="wishlist/item/configure/addto.phtml" />
        </reference>
        <reference name="product.info.options.wrapper.bottom">
            <action method="unsetChild"><name>product.info.addto</name></action>
            <action method="append"><block>product.info.addto</block></action>
        </reference>
    </wishlist_index_configure>

    <wishlist_shared_index translate="label">
        <label>Customer Shared Wishlist View</label>
        <!-- Mage_Wishlist -->
        <reference name="content">
            <block type="wishlist/share_wishlist" name="customer.wishlist" template="wishlist/shared.phtml" />
        </reference>
    </wishlist_shared_index>
</layout>

Magento Version 1.9.1. Thank you in advance!

1

After thinking about it and poking around in the Magento code, I have decided not to pursue this anymore for the following reasons.

  1. The shopping cart and wishlist are 2 different animals and used for different reasons.

  2. The cart has lots of logic not used by the wishlist including promotions, coupons, free shipping, weight, etc.

  3. A shipping quote would depend on the day the package is sent so preparing a shipping quote for a wishlist that isn't ordered for 2 weeks will not be accurate.

I hope anybody else considering this will find this information useful. It would take a major overhaul to make the wishlist act more like a cart and in hindsight, it's not worth the trouble, at least on my end.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.