Post by labeshops » Sun Aug 13, 2023 2:09 am

Just discovered for some odd reason, opencart (v3.0.3.2) is generating CRAZY long affiliate link codes for my customers. Like peixlImJr5kuyH03bqrtz6iOJ9mwezwbTSeBwhLLjHDZqUOMA0MYqeaiGUStMpqd

I do have 78999 registered customers (though most don't need affiliate codes though of course opencart 3 auto assigns them a code). So I suspect this is why it is long, but...how can I get them as short as I can while keeping them unique??
Last edited by labeshops on Wed Aug 16, 2023 8:56 pm, edited 1 time in total.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by straightlight » Sun Aug 13, 2023 2:55 am

labeshops wrote:
Sun Aug 13, 2023 2:09 am
Just discovered for some odd reason, opencart (v3.0.3.2) is generating CRAZY long affiliate link codes for my customers. Like peixlImJr5kuyH03bqrtz6iOJ9mwezwbTSeBwhLLjHDZqUOMA0MYqeaiGUStMpqd

I do have 78999 registered customers (though most don't need affiliate codes though of course opencart 3 auto assigns them a code). So I suspect this is why it is long, but...how can I get them as short as I can while keeping them unique??
By shorting the string, you may no longer be able to track the affiliate codes in the future unless you're using a reliable provider that can use SQL queries with LIKE clause, for instance or if you do it locally by knowing who would actually own those affiliate codes. However, the 2nd option is less recommended.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Sun Aug 13, 2023 9:04 pm

Where are you seeing the long codes?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by hpwebdesign » Mon Aug 14, 2023 4:01 pm

We have an affiliate module which makes affiliate links short and easy to read, you can see full description at https://hpwebdesign.io/advanced-affilia ... t-opencart

HP Web Design
Powering Digital Commerce | http://hpwebdesign.io | http://opencart.id
Opencart Professional Services | Create OpenCart Online Store | OpenCart Tutorials


User avatar
Active Member

Posts

Joined
Wed Aug 15, 2018 6:58 am
Location - Yogyakarta

Post by labeshops » Mon Aug 14, 2023 11:33 pm

ADD Creative wrote:
Sun Aug 13, 2023 9:04 pm
Where are you seeing the long codes?
Looking at the customer table in phpmyadmin after a customer told me about it. If I register myself and then look at the affiliate code it gives me, I also see a long one like this.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Mon Aug 14, 2023 11:34 pm

straightlight wrote:
Sun Aug 13, 2023 2:55 am
labeshops wrote:
Sun Aug 13, 2023 2:09 am
Just discovered for some odd reason, opencart (v3.0.3.2) is generating CRAZY long affiliate link codes for my customers. Like peixlImJr5kuyH03bqrtz6iOJ9mwezwbTSeBwhLLjHDZqUOMA0MYqeaiGUStMpqd

I do have 78999 registered customers (though most don't need affiliate codes though of course opencart 3 auto assigns them a code). So I suspect this is why it is long, but...how can I get them as short as I can while keeping them unique??
By shorting the string, you may no longer be able to track the affiliate codes in the future unless you're using a reliable provider that can use SQL queries with LIKE clause, for instance or if you do it locally by knowing who would actually own those affiliate codes. However, the 2nd option is less recommended.
yes, but most of those customers are not actually affiliates so it's not an issue if I can just create shorter ones for all new customers. I can then email existing affiliates with long codes to please change your code - there are only a handful of active ones with the long codes.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by ADD Creative » Tue Aug 15, 2023 7:48 am

You could try modifying the line at the link below. Change the token(64) to a smaller number.

https://github.com/opencart/opencart/bl ... r.php#L130

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by labeshops » Wed Aug 16, 2023 8:55 pm

ADD Creative wrote:
Tue Aug 15, 2023 7:48 am
You could try modifying the line at the link below. Change the token(64) to a smaller number.

https://github.com/opencart/opencart/bl ... r.php#L130
Thanks! That seems to have done the trick!

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA
Who is online

Users browsing this forum: No registered users and 29 guests