WordPress.org

Ready to get started?Download WordPress

Forums

FoxyShop
[resolved] Change the HTML that functions output (6 posts)

  1. c-m
    Member
    Posted 1 year ago #

    How do I change the actual HTML outputted by the functions?

    For example foxyshop_product_variations() will show the variations and quantity dropdowns. But I want to amend the code to include prepends.

    Likewise I want to separate out the main product image, from the product thumbnails, and place them in different containers on my page.

    http://wordpress.org/extend/plugins/foxyshop/

  2. sparkweb
    Member
    Plugin Author

    Posted 1 year ago #

    You'll want to inspect helperfunctions.php. In some cases you can just make your own function in functions.php as a copy. In other cases you may be able to use WordPress hooks to change the code.

  3. c-m
    Member
    Posted 1 year ago #

    Thanks for the response.

    I can see in helperfunctions.php that the line below writes "Quantity"

    $quantity_title = apply_filters("foxyshop_quantity_title", "Quantity");

    Now I want to change this to read "QTY" which is simple enough, but how to do that using my themes custom functions.php as oppose to editing helperfunctions.php

    Presumably isn't just as simple as copying that one line and adding it to my themes functions.php?

  4. sparkweb
    Member
    Plugin Author

    Posted 1 year ago #

    See this page for a lot of examples of how to write the FoxyShop hooks: http://www.foxy-shop.com/documentation/advanced-customization/

    And this: http://wp.tutsplus.com/tutorials/the-beginners-guide-to-wordpress-actions-and-filters/

    Here's the specific sample you need: http://pastebin.com/Bbw5Ua50 - the function would just say "QTY"

  5. c-m
    Member
    Posted 1 year ago #

    Cool.

    In your sample the line:

    if ($product['code'] == "code1") {

    Did you mean != instead of == ? As "code1" would be a single specific product code as oppose to a placeholder that automatically pulls in the code of the product in that particular Foxycart form.

  6. sparkweb
    Member
    Plugin Author

    Posted 1 year ago #

    This is just a sample that says "if the product code is 'code' do this"

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags