• Resolved robicus

    (@robicus)


    I’m trying to use Amazon Auto Links to transition several websites from Amazon Associates Link Builder (discontinued Mar 9, 2020). Our AALB shortcodes all have values for the ‘text=’ argument. I’d like for the value in the old AALB shortcode’s ‘text’ argument to appear in the new AAL output, rather than the product’s Title.

    Right now, I have this:

    <a href="<?php echo esc_url( $_aProduct[ 'product_url' ] ); ?>" target="_blank" rel="nofollow">
    	[[AALB's_'text'_value_to_appear_here]]
    </a>

    What should I use in place of the [[AALB’s_’text’…]] in our custom template?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Not sure exactly what you are looking for but sounds like you want to convert AALB text shortcodes into Amazon Auto Links outputs.

    You should try the development version v4.0.0b.

    1. Install and activate the development version (v4.0.0b07).
    2. Go to Dashboard -> Amazon Auto Links -> Templates and activate Text.
    3. Go to Dashboard -> Amazon Auto Links -> Settings -> 3rd Party -> Amazon Associates Link Builder and enable it.
    4. Add a template conversion item with ProductLink (AALB) -> Text (AAL) in the Template Conversion option.

    Let me know if this works for you or not. If it’s not what you are looking for, post the exact shortcode with parameters which you want to convert.

    Thread Starter robicus

    (@robicus)

    Hello,

    That’s close to what we need! However, it returns a few things we don’t want (the item description from Amazon, namely).

    In a custom template, I’m trying to grab the value for ‘text=’ from AALB’s old shortcode. So, “Race Ramps RR-40” in the following example:

    [amazon_textlink asin='B003ZA8WIE' text='Race Ramps RR-40' template='ProductLink' store='storetaghere-20' marketplace='US' link_id='94c08f05-187c-4745-b4cf-31f08815468c']

    Is there some type of PHP code I could use in place of ((Link_Text_Here)) in the custom template code I have so far:

    <?php foreach( $aProducts as $_aProduct ) : ?>
    
    <a href="<?php echo esc_url( $_aProduct[ 'product_url' ] ); ?>" target="_blank" rel="nofollow">
    	((Link_Text_Here))
    </a>
    
    <?php endforeach; ?> 
    • This reply was modified 4 years, 9 months ago by robicus.
    • This reply was modified 4 years, 9 months ago by robicus.
    Plugin Author miunosoft

    (@miunosoft)

    So you are writing a custom template.

    Is an item description inserted with the Text template? It shouldn’t though. You should check the default Item Format option for the Text template. Go to Dashboard -> Amazon Auto Links -> Settings -> Default -> Template. Select Text and in Output Formats -> Item Format, if %description% is inserted, remove it.

    It should be something like

    
    <a href="%href%" title="%title_text%: %description_text%" rel="nofollow noopener" target="_blank">%title_text%</a>
    

    If you still need to go with a custom template, maybe try

    
    echo $aArguments[ 'product_title' ];
    

    You can check the variable contents with the Debug template by the way.

    Thread Starter robicus

    (@robicus)

    That worked! This will be really helpful with our custom templates moving forward. Removing the %description% from Item Format also worked for your provided ‘Text’ template.

    Thank you for your quick help! Plugin donation coming your way shortly. ??

    Plugin Author miunosoft

    (@miunosoft)

    You are welcome. Glad to hear it works!

    Would be appreciated if you could take a few minutes to write a comment on the plugin. The best way to help the development of the plugin is to go with Pro. If you can be a beta tester, a discount can be applied as well. This is subject to change at any moment especially when we have an enough number of testers.

    Thank you for your consideration.

    Plugin Author miunosoft

    (@miunosoft)

    Thank you so much for the donation!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use AALB’s ‘text’ value in AAL’s Custom Templates’ is closed to new replies.