Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eStore – Need Meta Key of Product ID for Essential Grid

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › eStore – Need Meta Key of Product ID for Essential Grid

Tagged: custom data, essential grid, shortcode

  • This topic has 4 replies, 2 voices, and was last updated 5 years ago by stalyan.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 1, 2020 at 10:10 pm #14518
    stalyan
    Participant

    Hi,

    When you edit a skin in Essential Grid you can also add meta keys. I’ve been able to include a Add Cart button going to Layout Settings > Source > Blank HTML but as in Essential Grid a skin is a template that applies to all images of let’s say a Playlist, the problem is that I have an Add Cart button of a specific song image by internal ProductID, that same product id will be replicated to all the other song images, when they are actually different products.

    So instead of pasting [wp_eStore_fancy1_no_thumbnail id= 1] in the Blank HTML, I would need to paste something like:

    [wp_eStore_fancy1_no_thumbnail id= MetaKeyOfProductID]

    being MetaKeyOfProductID a numerical value. No problem to create this key pair from another plugin of directly on a post, but I need to know is somehow I can make eStore to recognize that.

    (I don’t ask for a feature to be included, just asking if it’s possible or if it’s too complicated i’ll appreciate if you can point me out on the direction to investigate on my own :)

    I don’t know how i can attach images let me know.

    Thanks,

    Abel

    May 1, 2020 at 11:40 pm #80527
    wzp
    Moderator

    (I don’t ask for a feature to be included, just asking if it’s possible or if it’s too complicated i’ll appreciate if you can point me out on the direction to investigate on my own :)

    Many of the eStore shortcodes have equivalent PHP function calls. Perhaps you might be able to use them?

    • https://www.tipsandtricks-hq.com/ecommerce/wp-content/uploads/wp-estore-shortcodes.pdf
    • https://www.tipsandtricks-hq.com/ecommerce/wp-content/uploads/extra-eStore-shortcodes.pdf

    May 2, 2020 at 11:03 pm #80528
    stalyan
    Participant

    Thanks for the info.

    I managed to complete the first part of the problem, that is getting the productID from post custom data and add it to the eStore PHP code.

    <?php

    $customMeta = get_post_meta(get_the_ID(), ‘eStoreProductID’, TRUE);

    printf( ‘The value of my post meta is %s’, $customMeta );

    echo show_product_fancy_style($customMeta);

    ?>

    I used XYZ PHP Code to create a shortcode of this. Then if I put this shortcode called RetrieveCustomMetaToVariable on a post that has custom data ‘eStoreProductID’, which has the same value of the product id in eStore, it will display the correct Add to Cart button and associated info.

    Now my problem is how to pass this into the Essential Grid Skin editor (EGSE) so the Add to Cart button is displayed within each song cover in the grid. EGSE has a HTML/Text form but i cannot use it to post XYZ PHP Code shortcodes. Also, I cannot post any eStore HTML shortdcode in the form because the productid of eStore HTML shortcodes must be a fixed number and not a variable. If I paste PHP code directly there it just does not work either.

    I found this in Essential Grid customer support: https://www.themepunch.com/faq/create-a-custom-shortcode-in-essential-grid/

    It’s my only hope to somehow try to adapt the PHP code that I posted to create a shortcode as specified in the link above, but using the eStoreProductID variable as a function argument that I can use as argument of this newly created shortcode that Essential Grid should recognize.

    [AddToCartButton %eStoreProductID%]

    I must say i do not know PHP but I have some basic programming understanding.

    If you mind, please let this thread open for if someone has faced this issue and can help, or so that I can post a solution that anyone can profit from in hopefully a few days when i figure this out.

    Thanks in advance,

    Abel

    May 3, 2020 at 11:59 pm #80529
    wzp
    Moderator

    Are you able to use URL links?

    https://support.tipsandtricks-hq.com/forums/topic/estore-how-to-use-a-text-link-to-accommodate-the-purchase-of-a-product

    May 9, 2020 at 6:15 am #80530
    stalyan
    Participant

    I added this code to functions.php of my theme and it solved the problem.

    function AddToCartByProductID( $atts ) {

    $args= shortcode_atts(

    array (

    ‘id’ => 0

    ),

    $atts );

    return get_button_code_for_product($args);

    }

    add_shortcode( ‘add_to_cart_by_prod_id’, ‘AddToCartByProductID’);

    Thanks for your help this thread can be closed if you want.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ