MarketPress Shopping Cart "Shipping Method" Code

Hello,

I’d like to know where to find the function that outputs the code for the ‘shipping method’ portion of the shopping cart/shipping page. I’m just like to change to output html slightly for a more responsive layout.

Thanks

  • Patrick Cohen
    • Technical Docs Wrangler

    Hey there @alex_blasingame

    I hope you’re well today!

    I believe you’ll find what you’re looking for in marketpress/marketpress-includes/template-functions.php

    See also the additional info in marketpress/marketpress-includes/themes/Themeing_MarketPress.txt

    However, you may not need to change anything in the template html if you just need to tweak stuff a bit to make it more responsive. That can most often be achieved just with CSS.

    Can you provide a mockup of what you’d like your cart to look like? We could perhaps help with that if needed.

  • alex_blasingame
    • Site Builder, Child of Zeus

    Thanks for the quick reply. I was unable to find the section of code I’m looking for in template-functions.php or anywhere else obvious. Specifically, I’m look the code that returns on the shopping cart shipping page under where you enter in your address:

    <tbody><tr><td align="right">Shipping Method:</td><td id="mp-shipping-select-td"><input type="hidden" name="action" value="mp-shipping-options"><select name="shipping_option" id="mp-shipping-select"><option value="usps" selected="selected">USPS</option></select> <span id="mp-shipping-select-holder"><select name="shipping_sub_option" size="4"><option value="First-Class Mail Parcel" selected="selected">First-Class Mail Parcel (2-4 days) - $3.04</option><option value="Priority Mail">Priority Mail (2-4) days - $6.50</option><option value="Express Mail">Express Mail (1-2 days) - $24.20</option></select></span></td></tr></tbody>

    Above, I’ve pasted code from what the section currently looks like. It’s more of a pain to apply responsive CSS to a table than just to straight divs. However, in the meantime I’ve applied CSS tweaks to the existing table structure to suit my needs. It would be nice to know where this function is though, in case I want to make changes in the future.

    Thanks

  • Sajid
    • DEV MAN’s Sidekick

    Hi @alex_blasingame

    Hope you are doing good today :slight_smile:

    Yes! I can understand making tables responsive is pain. I guess you want to add some Div elements around table.

    Its coming from marketpress/marketpress-includes/marketpress-shipping.php file and you can override it with following filter hook.

    mp_checkout_shipping_field

    Hope it helps :slight_smile:

    Cheers, Sajid