View Issue Details

IDProjectCategoryView StatusLast Update
1521Composr documentationGeneral / Uncategorisedpublic2014-12-02 23:05
ReporterChris Graham Assigned ToChris Graham  
PrioritynormalSeverityfeature 
Status resolvedResolutionfixed 
Summary1521: Custom product field workaround for PayPal
DescriptionChange the ECOM_CART_BUTTON_VIA_PAYPAL.tpl template to...

<form title="{!MAKE_PAYMENT}" class="right" action="{IPN_URL*}" method="post">
    <input type="hidden" name="cmd" value="_cart" />
    <input type="hidden" name="upload" value="1" />
    <input type="hidden" name="business" value="{PAYMENT_ADDRESS*}" />
    <input type="hidden" name="return" value="{$PAGE_LINK*,_SEARCH:shopping:finish:from=paypal}" />
    <input type="hidden" name="notify_url" value="{$FIND_SCRIPT*,ecommerce}?from=paypal" />
    <input type="hidden" name="no_shipping" value="0" />
    <input type="hidden" name="cancel_return" value="{$PAGE_LINK*,_SEARCH:shopping:finish:cancel=1:from=paypal}" />
    <input type="hidden" name="currency_code" value="{CURRENCY*}" />
    <input type="hidden" name="custom" value="{ORDER_ID*}" />
    <input type="hidden" name="rm" value="2" />

    {+START,IF_NON_EMPTY,{MEMBER_ADDRESS}}
        <!-- <input type="hidden" name="address_override" value="1" /> -->
        {+START,LOOP,MEMBER_ADDRESS}
            {+START,IF_NON_EMPTY,{_loop_key*}}
                <input type="hidden" name="{_loop_key*}" value="{_loop_var*}" />
            {+END}
        {+END}
    {+END}

    {+START,LOOP,ITEMS}
        <input type="hidden" name="item_name_{$ADD*,1,{_loop_key}}" value="{PRODUCT_NAME*}" />
        <input type="hidden" name="amount_{$ADD*,1,{_loop_key}}" value="{PRICE*}" />
        <input type="hidden" name="quantity_{$ADD*,1,{_loop_key}}" value="{QUANTITY*}" />

        


            <input type="hidden" name="on0_{$ADD*,1,{_loop_key}}" value="Size" />
            <label for="os0_{$ADD*,1,{_loop_key}}">Size of {PRODUCT_NAME*} <span class="associated_details">(if applicable)</span></label>
            <select name="os0_{$ADD*,1,{_loop_key}}" id="os0_{$ADD*,1,{_loop_key}}">
                <option>Small</option>
                <option selected="selected">Medium</option>
                <option>Large</option>
                <option>Extra Large</option>
            </select>
        


    {+END}

    <p class="purchase_button">
        <input class="button_page" type="image" src="{$IMG*,page/cart_checkout}" name="submit" alt="{!PROCEED}" title="{!PROCEED}" />
    


</form>

{+START,IF_NON_EMPTY,{NOTIFICATION_TEXT}}
    <div class="checkout_text">{NOTIFICATION_TEXT}</div>
{+END}
Additional InformationWhen you are on the cart, just above the paypal button it will show a size option for each item in your cart. This will come though on the PayPal payment e-mail.

It's not perfect, ideally we'd let each product define what options it has, show it in a nicer place in the interface, and feed through the data to the order management screen. But it's quick and it works well enough for most simple T-shirt sellers.
TagsNo tags attached.
Attach Tags
Time estimation (hours)
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised