Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Custom Product ID in Shortcode Daily
- This topic has 10 replies, 2 voices, and was last updated 13 years, 2 months ago by bvimusic.
-
AuthorPosts
-
September 14, 2011 at 12:37 pm #4314bvimusicMember
Hello,
I would like to have my shortcode in a widget but have a different product id# generated into the product ID daily – for is it possible to somehow do something like the following:
[wp_eStore_add_to_cart id=todays date] for example, if my product ID within the database is 20110914 – for today’s day?
September 14, 2011 at 11:06 pm #36638adminKeymasterIf the product ID in the database is set to “20110914” then the following will work but eStore doesn’t have any option to generate product ID based on date or let you change the ID from eStore’s interface:
[wp_eStore_add_to_cart id=20110914]
If you want to change the product ID you will have to do it directly in your database. This post will explain how:
September 15, 2011 at 12:46 am #36639bvimusicMemberI’m not sure I was clear in my initial post.
I am wanting to put the shortcode on a page and have it automatically generate a product number, based on what day it is.
Is this possible?
September 15, 2011 at 1:47 am #36640adminKeymasterNope, WP eStore’s product IDs are numerical and it cannot be changed unless you manually change it in the database.
September 15, 2011 at 3:44 am #36641bvimusicMemberWhat I am now is:
If I customize the database with product names for dates…
is there a way that the shortcode can ‘grab’ that product id, based on the current date?
*my apologies, I realize now when I read my previous post that it wasn’t clear.
September 15, 2011 at 5:01 pm #36642bvimusicMemberlet me rephrase this question:
will the database have a problem if I were to change product 1 — and rename it to product 20110916
?
I have realized that I will be able to use javascript to generate the variable.
September 16, 2011 at 12:16 am #36643adminKeymasterI don’t think the database will have an issue since this new ID is also unique.
We don’t allow the product ID to be changed in eStore. No one ever tried this and hence I don’t have any confirmed data to back this up unfortunately.
September 18, 2011 at 7:51 pm #36644bvimusicMemberi’ve got this entire thing working. It’s very nice.
September 18, 2011 at 7:56 pm #36645bvimusicMemberthe video on how to edit the database table that was provided helped a lot.
September 19, 2011 at 12:10 am #36646adminKeymasterGlad to hear that. Maybe share with us what you did (someone else might find this useful)?
September 19, 2011 at 1:32 am #36647bvimusicMemberWell, I ended up getting someone do it using javascripting and putting that code into a .php widget. I will try and publish it when I can, but it also requires editing the dataabse.
-
AuthorPosts
- You must be logged in to reply to this topic.