The plugin has worked brilliantly so far after I managed to tweak it for my needs! Thanks again!
However, I would like to display a message dependant on location and I would really like to use your plugin for this, there is no point in trying to insert more localization code, so I’ve been trying to use it.
Can you tell me if there is any simple shortcodes that ONLY detects the location? I’m looking to do something like this within my posts [if_uk echo=Hello] [if_us echo=yo] [if_eu echo=hello europe].
Thanks again buddy.
The plugin can do this, its probably not the most efficient way to do it but it should work fine:
Create a template with a single keyword in e.g. have a template named ‘text’ containing just ‘
Then put a shortcode in your post along the lines of:
[amazon template=text&text[us]=yo&text[uk]=hello&text[fr]=bonjour&text[de]=hello europe]
Hope that helps,
Fantastic, what an excellent plugin indeed. =]
I did run into one other little hiccup also that I wasn’t able to resolve. When a product doesn’t exist in one amazon, it obviously goes to amazon’s 404, is there a way to send visitors from the amazon that is broken to another site. (I would manually check amazon.com and .co.uk, and if 404 then I’d manually want to send relevant users to different website)
I.e use shortcode to set links
Thanks again Paul, you are the greatest.
I’m currently updating the plugin to provide support for non-Amazon links, so in the future you could put in something like:
Its tricky trying to balance all the various ways of generating the URL!
Is this what you are after?
That is exactly what i’m trying to accomplish!
Is it not feasible to simply do a simple if? If = 10 digits, then do amazon code, if not then echo the code literally for that localization?
Have you got any timescales for this update?
The development version currently supports this, but it still needs testing, you can download it from here:
I agree it would be nice to do it as you say and implicitly derive what link type to present based on the content of a single keyword. However I have come unstuck doing this sort of implicit ‘type’ recognition before so I tend to prefer more explicit arguments.
For example the new version supports the following link types:
Product Link (Based on ASIN)
Review Link (Based on ASIN)
Search Link (Based on Keywords)
Reference Link (Based on a Unique ‘Reference’)
URL Link (A direct URL with no translation).
As you can see distinguishing between a ‘relative link’ at
NewFictionand a reference of
NewFiction, a search link of
New Fictionand an 10 digit ASIN of ‘NE4F1CT10N’ is not quite as simple as it first appears!
e.g. It might work fine on your site where you are careful, but someone else not aware of the various ways to create links might come unstuck.
Fantastic, I will test that version soon.
Another small side note that I forgot to ask you too, is I contacted Amazon and they say that if you show live prices through the API and they are more than 1 hour old, then you have to put a time stamp saying when the price is from. How old/often does your plugin retrieve the prices?
If the cache is not enabled then they are live prices, if the cache is enabled then their age depends upon the ‘Cache Data Age’ setting.
I guess that is for the ‘Offer’ price rather than the List price though?
I could add the ‘timestamp’ of the cache data as a template item – the preferred data format must be one of the standard WordPress settings.
I will simply leave cache off, much simpler and doesn’t seem to have an effect on anything! (I only have one live price per page).
Well, Amazon simply told me “live price” so to ensure that you are 100% not breaking any rules, i’d assume they mean any price.
Another little thing I found was that you set it so that each user can add their own affiliate links in their wordpress user profiles. Can you tell me where this is coded in please? I have some friends writing on my site, and would much prefer if they didn’t have that option. Thanks.
In the file amazon.php in the function admin_menu()
The last 4 lines add the user_options:
add_action('show_user_profile', array($this, 'show_user_options') ); // Display User Options add_action('edit_user_profile', array($this, 'show_user_options') ); // Display User Options add_action('personal_options_update', array($this, 'update_user_options')); // Update User Options add_action('edit_user_profile_update', array($this, 'update_user_options'));// Update User Options
Just comment them out / remove them.
Here’s another idea I ran into – Have you ever looked at adding links to images? Not amazon images, but uploaded media images and have them clickable to an Amazon ASIN with localisation?
You can do this manually using the plugin already if you know the URL of the image, e.g. using the standard ‘image’ template:
What did you have in mind? Add a button to the WordPress Media window that automatically generated a shortcode using that Media item? Or something else?
I have successfully used this method to include a link from my local image, but the tooltip that should display the alt text returns “Undefined.” Where/how do I fix this?
Blog is at uxideas.supinski.com — it is implemented on the “100 ideas” post.
Depends upon the template you are using, usually the alt text for the image is provided by the
%TITLE%keyword, so in your shortcode if you are not using live data you need to provide the title. Just add:
&title=my titleto the end of your shortcode arguments.
In the above example:
[amazon template=image&asin=0123456789&image=http://www.mydomain.com/wp-content/uploads/2012/12/my_image.jpg&title=my title]
Hope that helps,
- The topic ‘Using localisation’ is closed to new replies.