WooCommerce not saving post meta value - wordpress

In my WooCommerce site i have create a product and in this product i have attached a lot of pdf files so that after user buy it he can download all these pdf files but the problem is that in this product i have more than 375 files so after added 320 files its working fine and when i add 319 product and hit update button page updated successfully but the 321th products is removed i thought it was some mistake so i added it back and same thing happen i don't know why i just enable the debug log
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
but noting log no error just removed the 321th record can anyone please tell me is there any limit of woocommerce or anything else o this problem can be resolved
Thanks

this is probably happening because you must be passing input limits on the form submit. To solve this you will need to open php.ini from your server and increase the max_input_vars variable which will probably be 1000 to 2000.
This happens because for each field you generate woocommerce must be generating one or two more. what goes over the edge. so just increase it and restart that will solve.
Some hosts will not let you modify or increase php.ini in which case you should contact the host and request the increase.

Related

Site whitening when loading

I created a site with WordPress
I also use the Promosys template
When I open the site, the site is white for 30 seconds and then it shows the information
Interestingly, the site is loaded but shows a white screen and is displayed after 30 seconds
I am using the wprocket plugin, I felt that there might be a problem with this plugin, I disabled it but it did not work
first, try to increase PHP memory limit by adding the code below to your wp-config.php
define( 'WP_MEMORY_LIMIT', '256M' );
could be a problem with your theme as well.
try with a default wordpress theme and let us know how it goes after adding the code.

wordpress site showing warrning in some section

my wordpress site is running ok but in some section this warning is shown
Warning: Parameter 2 to gdlr_core_page_builder::search_page_builder() expected to be a reference, value given in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 287
wordpress ver:5.4.1
i deactive all plugin and active one by one and found when i deactive one of the plugin (Goodlayers Core
) not showning error anymore but all element of site is disappear because it's core of theme it seems.
The error describe itself.
From somewhere the 2nd parameter of the function gdlr_core_page_builder::search_page_builder() is passed as value which should be a reference.
The error showing in file class-wp-hook.php on line 287 because of there is some hook is added into the above function.
You can contact that plugin author who will fix this issue if it is exist and release that plugin update.
This is a plugin issue. However, you can simply disable the displayed warning by adding the below lines of code in wp-config.php file.
Locate your file under cPanel FileManager:
/home1/yoursitename/public_html/wp-config.php
Add the below lines of code to hide the displayed warning:
ini_set('display_errors', 'Off');
ini_set('error_reporting',E_ALL);
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
Had the same issue, fixed by removing vars passed by reference (&$) on the file /wp-content/plugins/goodlayers-core/framework/function/page-builder.php:
open the file
search for &$, replace by $
save, refresh website (clear cache if needed), error is gone

Menu page not showing in WP Admin section

I have a WordPress eCommerce website in this website all working but admin menu page not working and the page showing blank, and I was trying to add a new image that image does not upload and not showing the old image in media library only loading process see attachment
In order to solve this issue, you need to see what error is causing this blank page. By default, PHP suppresses errors display for security reasons, but Wordpress has a setting to show the errors.
In order to turn on error display, open your wp-config.php in the root folder
And add these two lines:
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG', true );
NOTE: You must insert this BEFORE /* That's all, stop editing! Happy blogging. */ in the wp-config.php file.
You can read more here: https://wordpress.org/support/article/debugging-in-wordpress/
Only after you do that you will be able to see the error instead of a blank page, and then share it here to help us solve it or google for solution yourself.

How can I display Product Images to Logged In Users only, with Logged Out Users seeing an alternative image?

I would like to modify my WordPress/WooCommerce website, so that my Product Images have the following conditions:
Logged in site visitors:
I would like logged in visitors, to be able to see all of the WooCommerce Product Images.
Logged out site visitors:
I would like logged out visitors, to see an alternative image. Therefore, hide the Product Image. This alternative image, will be the same for every Product.
Firstly, you are going to need to create a Child Theme, for your WordPress/WooCommerce website.
Once created, simply insert the following code, into the functions.php file, within your Child Theme:
<?php
// Remove Default WooCommerce Product Images/Placeholders.
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
// Create conditional logic function.
function logged_in_images(){
// If site visitor is Logged in, display Default WooCommerce Product Images/Placeholder.
if ( is_user_logged_in() ) {
echo woocommerce_show_product_images();
}
// If site visitor is not logged in, display the following Image instead.
else {
echo '<img src=http://vaporcenter.be/theme/Wholesale/img/placeholders/default.jpg?1504084579>';
};
}
// We are inserting ('Hooking' into) the above function into where the Default WooCommerce Product Image/Placeholder was, before we removed it.
add_action( 'woocommerce_before_single_product_summary', 'logged_in_images', 20 );
?>
Be sure to replace http://vaporcenter.be/theme/Wholesale/img/placeholders/default.jpg?1504084579 with your desired image.
Don't forget, you can remove the comments (// ...) from the code. They are there, to just help explain what is happening.
I have tested the above code and it does work.
Best of luck!
If you receive an error
Step One: Using an FTP client, such as Filezilla, go into your Root Folder (Where you installed WordPress).
Look for a file entitled wp-config.php and drag this to your computer.
Open the file, using Notepad/Notepad++ and look for the line define('WP_DEBUG', false); and change 'false' to 'true'.
Drag the wp-config.php file back from where you got it from.
Refresh the page you are having an issue. You should then see an error message, which will be helpful in addressing how to resolve any issues.
Once you have resolved your issue, and your website is back in working order, head back into your wp-config.php and change 'true' back to 'false'.

Wordpress Auto Draft disabling

I am using Wordpress v.3.3.1 With Multisite management on.
I am trying to disable the auto draft function, but it seems that I have tried everythig.
What I have tried:
define('WP_POST_REVISIONS', false);
define('WP_POST_REVISIONS', false);
Didn't work.
I have tried to remove the auto_save lines in post-new.php, post-php. Both in wp-includes and in wp-admin. Didn't work.
I have also tried several plugins, but they won't do it! Any idea why?
I notice that you are asking about disabling Auto-Drafts and NOT Auto-Save.
You cannot disable Auto-save, but you can achieve a similar affect by setting a long interval, for example:
define( 'AUTOSAVE_INTERVAL', 3600 ); // Default is 60
(You'd add it in your WordPress site's wp-config.php file.)
As for Auto-Drafts, you don't want to disable them. They are there for an important reason. Let me grab a quote or two for ya...
Samuel 'Otto' Wood, Tech Ninja at Audrey Capital (Matt Mullenweg's angel investment company), says:
Auto-drafts exist because of the fact that multiple users can create new posts at the same time. If two people enter post-new at roughly the same moment, then have their first autosaves occur nearly simultaneously, then there is a race condition that can cause one of them to get back the wrong post ID, which will cause a post to be overwritten/lost when they then continue editing the post.
The auto-draft creates the post and gets the ID of the new post before the editing screen is displayed, thus preventing two simultaneous authors from accidentally having the same post ID in the data in their browser.
Andrew Ozz, who worked on WordPress' TinyMCE integration, says:
This also makes it possible to upload images before the first draft is saved and they will be properly attached to the new post.
And lastly:
Auto-drafts are automatically deleted after 7 days of going unused. They're self-cleaning, basically. No need to worry about them.
A) Set it in your wp-config.php file. Else it won't work.
define( 'AUTOSAVE_INTERVAL', 3600 ); // autosave 1x per hour
define( 'WP_POST_REVISIONS', false ); // no revisions
define( 'DISABLE_WP_CRON', true );
define( 'EMPTY_TRASH_DAYS', 7 ); // one week
Open wp-config.php located in your WordPress root directory and add following code:
define('WP_POST_REVISIONS', false );
before of require_once ABSPATH . 'wp-settings.php'; or and top of the file.
For guys who use WordPress 5.0+ version with Gutenberg Editor, the below code snippet works to disable auto drafting/saving
/**
* Disables auto saving feature for Gutenberg Editor (set interval by 3600s)
*/
add_filter( 'block_editor_settings', 'rsm0128_block_editor_settings', 10, 2 );
function rsm0128_block_editor_settings( $editor_settings, $post ) {
$editor_settings['autosaveInterval'] = 3600;
return $editor_settings;
}
I think disabling it is not good (for example, when you parallely try to publish 2 posts, then there may be problems). So, instead, of disabling:
Method 1)
disable them slightly (without CORE-modifications), see this answer.
Method 2)
just clean them using this code or good plugin WP Clean Up

Resources