eggrace
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Woocommerce Account FieldsThank you
Forum: Plugins
In reply to: [WooCommerce] Checkout Address FieldsThank you
Forum: Plugins
In reply to: [WooCommerce] Only running a script for a particular roleThis worked!
Thank you so much for your time and experience.
CheersForum: Plugins
In reply to: [WooCommerce] Only running a script for a particular roleThank you so much, this has worked and I can see what is now the problem.
A non logged in visitor is not a ‘customer’ but they can still order.
But i cannot find anywhere what role is assigned to a site visitor.
Is there default that you know of?
Thank youForum: Plugins
In reply to: [WooCommerce] Only running a script for a particular roleI feel so bad for taking up your time and thank you for your assistance.
Unfortunately it still works for all roles.
Am I right in thinking that ‘customer’ is a standard WordPress role and I am not doing anything silly?Run script for ‘customer’
or
Not run script for ‘wholesale_buyer’ and ‘wholesale_tax_free’Maybe it needs an exception rather than an inclusion?
Sorry for the problems and thank you
Forum: Plugins
In reply to: [WooCommerce] Only running a script for a particular roleThank you so much for your assistance.
Below is the full code:
// Check current user role
$user = wp_get_current_user();
$roles = ( array ) $user->roles;if ( in_array( ‘customer’, $roles ) ) {
// Set a minimum number of products requirement before checking out
add_action( ‘woocommerce_check_cart_items’, ‘spyr_set_min_num_products’ );
function spyr_set_min_num_products() {// Only run in the Cart or Checkout pages
if( is_cart() || is_checkout() ) {
global $woocommerce;// Set the minimum number of products before checking out
$minimum_num_products = 24;
// Get the Cart’s total number of products
$cart_num_products = WC()->cart->cart_contents_count;// Compare values and add an error is Cart’s total number of products
// happens to be less than the minimum required before checking out.
// Will display a message along the lines of
// A Minimum of 20 products is required before checking out. (Cont. below)
// Current number of items in the cart: 6
if( $cart_num_products < $minimum_num_products ) {
wc_add_notice( sprintf( ‘We sell bottles in packs of %s.‘
. ‘<br />Current number of items in the cart: %s.’,
$minimum_num_products,
$cart_num_products ),
‘error’ );
}
}
}
}Unfortunately this does not run at all now regardless of the user role.
I am a bit of a notice.
I have set default site visitor and accounts as ‘Customer’ role type.
I also manually set up 2 wholesale account types.I only want the above script to run on the default ‘customers’; i don’t want it to run for my wholesale accounts.
Am I going about this the right way?
Many thanks for your help
Forum: Plugins
In reply to: [WooCommerce] Product Tabs on MobileThank you for your kind followup.
Yes it was some CSS messing it up.
Although I have yet to find a way to put a page title on the single product page.
Many thanks
ElliotThank you Rene,
I will have another go with your suggestions.I deleted the files based on this response you gave to a previous member:
‘in the documentation for using the free version it’s mentioned to overwrite all of them but when it comes to the plugins it’s better if you delete the old plugins or rename the plugin folder and then to copy the staging plugins folder to live.’
I must misinterpret. Does overwrite mean replace the content within each file? Or copy the file and add to the wp_content folder alongside the live site folders?
Many thanks
ElliotAs a follow up to my last post.
The final process says:
The last step is to tell the WordPress live site to use the database tables of the staging site.
For this, you need an FTP account to access your website and an FTP client. I recommend the use of filezilla. It’s entirely free and open source.
Login to your website with the FTP program and open the config file of your live site:
wp-config.php
Open the file in edit mode by opening the context menu with the right mouse button and select editUse FTP again and open the config file wp-config.php of your live site.
The file is located in /path_to_wordpress/wp-config.php
Change the value of $table_prefix to the same value that is used by the staging site, e.g.This suggests 2 wp-config.php processes. However if I cam reading it correclty it is the same process both on the Live site. So i don’t know why I am being asked to open it twice.
Many thanks for your assitance.
Hi,
I am using the free version and think its great.
However, I am struggling to push it live via the manual procress.
I am responding to this thread because it relates to the first process which for me is still not clear.
Above you say ‘it’s mentioned to overwrite…’However the manual i can see on my version (updated) says:
2. Step – Copy Files
Use an FTP program like Filezilla and copy over the folders wp-content/uploads, wp-content/plugins and wp-content/themes from your staging site subfolder to the production site.And not further explantion. So I don’t know if I cam doing it correctly.
FYI: I have copied staging folders into live site. And delated live site folders.At the end of the process; when i get to check the ‘new’ live site I get told to reinstall WP.
I have surely made a mistake in the process but I am not sure where.
Can you help?
Thank youForum: Plugins
In reply to: [WooCommerce] Adding a page title to a product pageAh ok, sorry i’ve taken enough time and it’s late for you.
I will try to find / add a hook.
All the best and thanksForum: Plugins
In reply to: [WooCommerce] Adding a page title to a product pageThanks.
Under the breadcrumb top left, same as your very first screenshotForum: Plugins
In reply to: [WooCommerce] Adding a page title to a product pageOk thank you, I will keep trying. I just can;t get it top left of the page.
Thank you for you help.
Cheers have a good eveningForum: Plugins
In reply to: [WooCommerce] Adding a page title to a product pageI am so sorry for taking your time so much but it is raining here and the internet gets slow.
I think you sent some margin code? But I can’t find itForum: Plugins
In reply to: [WooCommerce] Adding a page title to a product pageSorry I didn’t get your screenshot