Skip to content
Advertisement

Customizr Pro editing menu issue with some Woocommerce custom code

I attempted to ask Customizr support what my code was running into, but they basically said they do not support 3rd party plugins such as Woocommerce

I needed to restrict the payment types based on what folk were buying on the site. For example, the Check payment type is only available for people buying lessons.

Here is the code that does this:

JavaScript

I have dug into the Customizr files but I cannot find any conflict. The WordPress files can be a bit convoluted, so I might be barking up the wrong tree.

Advertisement

Answer

So the solution to this was much more simpler than I expected. Thank you @LoicTheAztec for the tips, I utilized Loic’s code for better optimization. The fix was to check if the user is admin

JavaScript

Then put the rest of the code in an else. Here is the full solution:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement