- Posts: 22
- Thank you received: 0
Setting partner_id first
12 years 9 months ago #136671
by apollo123
Setting partner_id first was created by apollo123
Hi,
I have run into an unforeseen problem.
My site is geared towards affiliate sales, only showing discounts if a partner_id is present.
Problem is, the discounts will not show on the initial page a viewer visits.
It seems the partner_id is set after the prices has been rendered, so it will only come into effect for the next page a user visits.
I can see that the order of the hikashop plugins, including the affiliate plugin are set to 0. Will it help reordering all others to 1?
A crude solution would be to check it there is a partner_id, and reload the page if this is the case.
-Not a great solution...
Hope to hear from you soon,
I have run into an unforeseen problem.
My site is geared towards affiliate sales, only showing discounts if a partner_id is present.
Problem is, the discounts will not show on the initial page a viewer visits.
It seems the partner_id is set after the prices has been rendered, so it will only come into effect for the next page a user visits.
I can see that the order of the hikashop plugins, including the affiliate plugin are set to 0. Will it help reordering all others to 1?
A crude solution would be to check it there is a partner_id, and reload the page if this is the case.
-Not a great solution...
Hope to hear from you soon,
Please Log in or Create an account to join the conversation.
12 years 9 months ago #136684
by apollo123
Replied by apollo123 on topic Setting partner_id first
I apologize for my impatience (time is short right now..).
If you have a better solution than doing this (when the document is loaded, hiding the initial results and replacing them with an updated version), I am all ears.
(This ajax call takes approximately 1.5s and does not reload the page, so it is workable)
var partner = window.location.href.indexOf('partner_id')
if(partner>-1){
$('.component-pad').hide() // hide the hikashop listings without discounts
$('.component-pad').load(window.location.href+'/tmpl-component .component-pad',function(){
$('.component-pad').show()
})
}
If you have a better solution than doing this (when the document is loaded, hiding the initial results and replacing them with an updated version), I am all ears.
(This ajax call takes approximately 1.5s and does not reload the page, so it is workable)
var partner = window.location.href.indexOf('partner_id')
if(partner>-1){
$('.component-pad').hide() // hide the hikashop listings without discounts
$('.component-pad').load(window.location.href+'/tmpl-component .component-pad',function(){
$('.component-pad').show()
})
}
Please Log in or Create an account to join the conversation.
12 years 9 months ago - 12 years 9 months ago #136776
by nicolas
Replied by nicolas on topic Setting partner_id first
Hi,
The partner_id is in the cookies of the browser of the user so of course, the user has to first display the page once so that the browser knows about the cookie before it can send it to the server.
So the best solution in your case would be to show the discounts only if the partner_id is in the cookies sent by the browser OR if it is in the GET. That way, you can avoid the redirect.
The partner_id is in the cookies of the browser of the user so of course, the user has to first display the page once so that the browser knows about the cookie before it can send it to the server.
So the best solution in your case would be to show the discounts only if the partner_id is in the cookies sent by the browser OR if it is in the GET. That way, you can avoid the redirect.
Last edit: 12 years 9 months ago by nicolas.
Please Log in or Create an account to join the conversation.
Time to create page: 0.157 seconds