- This topic has 1 reply, 2 voices, and was last updated 14 years, 6 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › automatically pull the PRODUCT NAME from the title of the blog post
First – Sorry. I posted this as a comment on another page before I knew there was a forum.
Is there a way to have the shortcode automatically pull the PRODUCT NAME from the title of the blog post? Each one of my posts is the name of the product and most of my products are all priced the same – It would be really helpful (and save a lot of time) if I was just able to paste a shortcode into each post (100+) and didn’t have to edit each one.
The short answer is not. You can however tweak the plugin to achieve what you are after.
If all of your products are same except the product name then you can do something similar to what I have done for the Alternate Method of NextGen gallery integration:
http://www.tipsandtricks-hq.com/ecommerce/nextgen-gallery-alternate-integration-method-805
Basically, you configure one product and use that as a template for the rest of the products (you will just change the product name dynamically with the post name).
If you want to take a look at the code and see what it does in the case of the nextgen gallery then open the “eStore_misc_functions.php” file and find the following function:
function print_eStore_ngg_buy_now($image)
If you have PHP knowledge then you should be able to replicate what that function does and write another one that suits your need. There is a WordPress function that you can call to get the Post Title so you can use it as the product name. This will only work for “Buy Now” type buttons though. “Add to Cart” type buttons require each product to have a unique product ID.