Public Ticket #2858795

Customer not assigned to agent if register from affiliate link

Closed
Comments
1 Ticket
Niraj Karwa started the conversation 5 years ago on August 27, 2021 at 11:30am

Actually I am using a plugin digits for login with otp. Your plugin affiliate link not working with that plugin. When user login with agent affiliate link it is not assigned to agent.

Suppose my website is example.com And user affiliate link is https://www.example.com/myaccount/?regid=BQEQJPW8A7

When new user clicks on affiliate link it goes to my account page and then my account page redirect to digits login page having url https://www.example.com/myaccount/?regid=BQEQJPW8A7&login=true&back=home&page=1

Help me !

2,762
KingsPlugins replied 5 years ago on August 27, 2021 at 2:57pm

Hi Niraj,

Thanks for purchasing SalesKing. 


This seems to be a compatibility issue with the Digits plugin.

Would you be able to provide us with a backend login to the site (or a Staging Site) so we can test and check settings and options? We don't have the Digits plugin for testing and it is difficult for us to replicate your setup.

We will try to look for options and workaround to make the 2 plugins work together.


Kind regards,

Stefan


2,762
KingsPlugins replied 5 years ago on August 27, 2021 at 4:01pm

Thank you for the login.

I checked and it appears the main issue is that Digits does not show our custom registration field. Normally there should be a "Sales Representative ID" field added to registration, that is essential for this to work.


I see that Digits does not work with the hook our plugin uses ( " woocommerce_register_form " ). 


I have messaged the Digits team via CodeCanyon to see if they can advise on what hook could be used instead for compatibility. I will update you as soon as I can.


Kind regards,

Stefan

2,762
KingsPlugins replied 5 years ago on September 13, 2021 at 11:28am

Hi Niraj,

We received a reply from the Digits team and I was able to add a code snippet here based on the info they provided: https://www.jktoners.in/wp-admin/admin.php?page=edit-snippet&id=1&result=updated

After testing, user registration through affiliate links seems to work now.

For example, you can register a customer at this link:

https://www.jktoners.in/my-account/?regid=LJCYBC4C4Q

And the customer will be assigned to the agent [email protected]

To log in as the agent, username and password are both [email protected]

Kind regards,

Stefan

1 Ticket
Niraj Karwa replied 5 years ago on September 14, 2021 at 2:08pm

Fantastic.

Now I am facing 2 issue.

1. when agent buy as customer website header is not showing.

2. agent update price is not updating when purchase as customer.



2,762
KingsPlugins replied 5 years ago on September 15, 2021 at 6:12pm

Regarding

1:

I've added some additional CSS that I believes resolves it. Let me know if you encounter any further issues.


2:

This functionality requires the "Update Cart" button to be pressed. This was not enabled in your theme settings. I enabled it now and now it can be used:

3940093684.png

Pricing is saved after clicking Update.

2,762
KingsPlugins replied 5 years ago on September 16, 2021 at 12:59pm

Hi,

To achieve that:

1. Make sure to update SalesKing to the attached version.

To update to this version:

- first deactivate the current plugin version in your site

- then upload and activate the attached plugin version

2. In the backend, go to Appearance -> Customize -> Additional CSS, and add this:

.salesking_shopping_as_customer #tbay-header{
    margin-top: 30px;
}

3. Go to Puca Options -> WooCommerce -> And disable "AJAX UPDATE QUANTITY":

1736443471.png
2,762
KingsPlugins replied 5 years ago on September 19, 2021 at 9:11pm

No, no. The change we made here will be in the next SalesKing update on CodeCanyon.


We sent you a newer version,  we just did not yet update it on CodeCanyon. After we update it, you can use that version there, you do not need a separate edited version.


1 Ticket
Niraj Karwa replied 5 years ago on October 18, 2021 at 12:59pm

Hello sir. Actually you are testing at stagging website. I am facing issue on main site. I had put code snippet directly in function.php file instead code snippet plugin. 

add_action('plugins_loaded', function(){

global $salesking_public;
add_action( 'register_form', array($salesking_public,'salesking_registration_link') );
add_action( 'digits_user_created', array($salesking_public,'salesking_assign_agent_registration') );

add_action ('digits_user_created', function($user_id){
if (isset($_POST['salesking_registration_link_hidden'])){
    $registration_value = sanitize_text_field($_POST['salesking_registration_link_hidden']);
    if (!empty($registration_value)){
    // get agent user ID
    $agent = get_users(array(
    'meta_key'     => 'salesking_agentid',
    'meta_value'   => $registration_value,
    'meta_compare' => '=',
    'fields' => 'ids',
));
if (count($agent) === 1){
update_user_meta($user_id,'salesking_assigned_agent', $agent[0]);

}
    }
    }
}, 10, 1);

});

2,762
KingsPlugins replied 5 years ago on October 18, 2021 at 1:06pm

You may need to move it to the code snippets plugin.

Sometimes it works a little differently in functions.php. Please try to set it identical to the jktoners.in site.

2,762
KingsPlugins replied 5 years ago on October 18, 2021 at 1:20pm

Hi there,

I can assure you the Code Snippets plugin is a very small plugin, with no effects on site performance. We use it all the time with no issues.


I am sorry, but we cannot rewrite the snippet for functions.php. The issue is that there is an order in which the hooks are fired in the site that is different when added differently. We discussed with the Digits team, and they advised us for what hooks to use in this setup. We would not know how to rewrite this. It would be necessary to contact the Digits team again.

1 Ticket
Niraj Karwa replied 5 years ago on October 19, 2021 at 2:13pm

I find out the issue. Actually I am using digits addon ( One click login and signup). Please recontact them them sir. Ask them for accordingly snippet code. 


thanks

2,762
KingsPlugins replied 5 years ago on October 19, 2021 at 2:15pm

All right, I understand the issue is with the One click login / signup addon.

I will contact them to ask about compatibility in this situation.


2,762
KingsPlugins replied 5 years ago on October 26, 2021 at 2:48pm

Hi there,

I checked now but I'm afraid we haven't received a reply on this yet. 

I will get follow up with them, and I will get back to you on this as soon as we can.

Kind regards,

Stefan

2,762
KingsPlugins replied 5 years ago on October 30, 2021 at 4:07pm

Sorry but they haven't gotten back to us.
If you can provide me with a staging site login that is identical to the main site, I can check to see if there is anything we can do to make it work.

2,762
KingsPlugins replied 5 years ago on November 7, 2021 at 6:55pm

Sorry but it seems the Digits team isn't able to help us with this.


If you can provide me with a staging site login that is identical to the main site, I can check to see if there is anything we can do to make it work.

2,762
KingsPlugins replied 5 years ago on November 21, 2021 at 11:54am

Sir, you have provided us access to your staging site.

You said that the issue is not in your staging site, only in your main site:

7681959146.png

If you would like to provide us access to the main site so we can see the problem, I am happy to check. 

Thank you

2,762
KingsPlugins replied 5 years ago on November 28, 2021 at 4:05pm

Hi,

I have modified the snippet here to try to get this working https://www.jktoners.in/wp-admin/admin.php?page=edit-snippet&id=1&result=updated


You will see that for example if you go to https://www.jktoners.in/my-account/?regid=LJCYBC4C4Q , the input value is set correctly:

1889829625.png


Then in the snippet we hook to digits_user_created and digits_new_user but it appears for some reason these are not firing as expected.


You can try the snippet to see if it works in your site, but likely we would need the digits team to provide us with a different hook, as it is likely not the right hook to use. I don't have another solution for this as we do not know their code and do not know what hooks are needed to be used here. 


Kind regards,

Stefan

2,762
KingsPlugins replied 5 years ago on December 5, 2021 at 3:00pm

Hi Niraj,

I'm afraid this is not something we can assist with further without direct help from the Digits team regarding an integration. Ultimately this is customization and it's not something directly covered by support. As much as we'd like to help, it's beyond our ability as we do not have knowledge of the other plugin. You'd have to either work with a programmer to take on this as a custom project, or look at whether the Digits team can do anything on their end.

Kind regards,
Stefan

1 Ticket
Niraj Karwa replied 5 years ago on December 29, 2021 at 11:00am

Still waiting your resolution. As I connected with digits plugin author he is saying no one is contacted or mail them from your side.

 Please do some needfull still I am not able to use your plugin even after 3 months gone.

Sign In