Buy Now Url In Catalog Mode - Being Chopped Off

I have my Catalog Mode set up and working properly; however, I am using long URL’s from Commission Junction’s product links. Whenever I enter a unique URL for a certain product and save it in the Buy Now URL section, it chops off my unique URL after I save it, thereby not directing the user to appropriate product on my affiliate’s site.



Please help. How can I fix this issue. Is there a particular piece of code that I can modify that will allow me to lengthen the Buy Now URL after is saved.

[quote name='wildman' timestamp='1308930590' post='115696']

I have my Catalog Mode set up and working properly; however, I am using long URL's from Commission Junction's product links. Whenever I enter a unique URL for a certain product and save it in the Buy Now URL section, it chops off my unique URL after I save it, thereby not directing the user to appropriate product on my affiliate's site.



Please help. How can I fix this issue. Is there a particular piece of code that I can modify that will allow me to lengthen the Buy Now URL after is saved.

[/quote]



Check the db field that stores this value. It probably has a max value set on it. Just increase this value in the table through PHPMyAdmin or a similar application.

Well I found a line in the file addon.xml under addons/catalog_mode.



Line 44 has varchar(255) field set. I changed this limit and then reuploaded, but it didn't work. I think you're right. The database now has a limit set somewhere. If anyone knows what exact field I should change in PHPmyadmin, I would greatly appreciate your help.

***********

SOLUTION

***********



Okay, so I figured it out. Here's the solution:


  1. You don't need to edit anything in your database or PHPmyadmin. If you already installed the Catalog Mode addon from the Administration Add-ons section, you need to go back and Uninstall it.


  2. Open this file in this directory:



    addons/catalog_mode/addon.xml


  3. Change this line of code on Line 44:



    From this…



    ALTER TABLE ?:products ADD buy_now_url varchar(255) NOT NULL



    To this…



    ALTER TABLE ?:products ADD buy_now_url varchar(65536) NOT NULL


  4. FTP the file back to the directory on the server.


  5. Install the Category Mode again and you're done.





    If you are interested in why I chose the long character limit of 65536, read this article:

    MySQL different treatment between VarChar(255) and VarChar(65536) - Stack Overflow