WordPress.org

Ready to get started?Download WordPress

Forums

Amazon Link
Using localisation (14 posts)

  1. capbell
    Member
    Posted 1 year ago #

    Hey again,

    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.

    http://wordpress.org/extend/plugins/amazon-link/

  2. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    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 '%TEXT%'.

    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,

    Paul

  3. capbell
    Member
    Posted 1 year ago #

    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

    [FR]=ASINNUMBER&[US]=ASINNUMBER&[UK]www.otherwebsite.com/product

    ?

    Thanks again Paul, you are the greatest.

  4. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    I'm currently updating the plugin to provide support for non-Amazon links, so in the future you could put in something like:

    [amazon asin[fr]=0123456789&asin[us]=9876543210&url[uk]=www.otherwebsite.com/product

    Its tricky trying to balance all the various ways of generating the URL!

    Is this what you are after?

    Paul

  5. capbell
    Member
    Posted 1 year ago #

    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?

  6. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    The development version currently supports this, but it still needs testing, you can download it from here:

    http://downloads.wordpress.org/plugin/amazon-link.zip

    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 NewFiction and a reference of NewFiction, a search link of New Fiction and 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.

    Paul

  7. capbell
    Member
    Posted 1 year ago #

    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?

    Thanks Paul

  8. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    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.

    Cheers,

    Paul

  9. capbell
    Member
    Posted 1 year ago #

    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.

  10. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    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.

    Paul

  11. capbell
    Member
    Posted 1 year ago #

    Brilliant! :-)

    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?

  12. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    You can do this manually using the plugin already if you know the URL of the image, e.g. using the standard 'image' template:

    [amazon template=image&asin=0123456789&image=http://www.mydomain.com/wp-content/uploads/2012/12/my_image.jpg]

    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?

    Paul

  13. lizsup
    Member
    Posted 1 year ago #

    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.

    Thanks!

  14. paulstuttard
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    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 title to 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,

    Paul

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.