[Skip to main content](#vessel-content)

#   Setting partner\_id first

##

- **[apollo123](/forum/user/1244-apollo123 "View apollo123's Profile")**
- [![apollo123's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1244-apollo123 "View apollo123's Profile") Topic Author
- [ Offline](/forum/user/1244-apollo123)

Less More

- Posts: 22
- Thank you received: 0
-
-

12 years 10 months ago [\#136671](#136671) by [apollo123](/forum/user/1244-apollo123 "View apollo123's Profile")  *[Setting partner\_id first](/forum/39-affilation/864369-setting-partner-id-first#136671 "Hi,  I have run into an unforeseen problem.  My site is geared towards affiliate sales, only showing discounts if a partner&#95;id is present. Problem is, the discounts will not show on the initial page a viewer visits.  It seems the partner&#95;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&#95;id, and reload the page if this is the case. -Not a great solution...  Hope to hear from you soon,")* was created by *[apollo123](/forum/user/1244-apollo123 "View apollo123's Profile")*

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,

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODY0MzY5LXNldHRpbmctcGFydG5lci1pZC1maXJzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[apollo123](/forum/user/1244-apollo123 "View apollo123's Profile")**
- [![apollo123's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1244-apollo123 "View apollo123's Profile") Topic Author
- [ Offline](/forum/user/1244-apollo123)

Less More

- Posts: 22
- Thank you received: 0
-
-

12 years 10 months ago [\#136684](#136684) by [apollo123](/forum/user/1244-apollo123 "View apollo123's Profile")  Replied by *[apollo123](/forum/user/1244-apollo123 "View apollo123's Profile")* on topic *[Setting partner\_id first](/forum/39-affilation/864369-setting-partner-id-first#136684 "Hi,  I have run into an unforeseen problem.  My site is geared towards affiliate sales, only showing discounts if a partner&#95;id is present. Problem is, the discounts will not show on the initial page a viewer visits.  It seems the partner&#95;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&#95;id, and reload the page if this is the case. -Not a great solution...  Hope to hear from you soon,")*

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&gt;-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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODY0MzY5LXNldHRpbmctcGFydG5lci1pZC1maXJzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 10 months ago -  12 years 10 months ago [\#136776](#136776) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Setting partner\_id first](/forum/39-affilation/864369-setting-partner-id-first#136776 "Hi,  I have run into an unforeseen problem.  My site is geared towards affiliate sales, only showing discounts if a partner&#95;id is present. Problem is, the discounts will not show on the initial page a viewer visits.  It seems the partner&#95;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&#95;id, and reload the page if this is the case. -Not a great solution...  Hope to hear from you soon,")*

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.

Last edit: 12 years 10 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM5LWFmZmlsYXRpb24vODY0MzY5LXNldHRpbmctcGFydG5lci1pZC1maXJzdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.183 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
