Hello @garyjh28
thank you for reaching out to us, we are here to help.
This feature is something that we intend to get developed but currently, we have no option of doing this in bulk. The only option is to adjust this manually in the setting of the product properties.
I have linked this thread to the feature request to bulk exclude from sync, but this can take some time before this will be approved/developed.
I had a short chat with our main developer and he advised:
for bulk, they can try wp cli running this command with all IDs via some simple script or something similar: https://github.com/inpsyde/PayPal-Zettle-POS/blob/dd2f7a33b52abc47921cc6c86202f0e7489b66de/modules.local/zettle-sync/src/Cli/ExcludeCommand.php#L56
I hope that can help you towards a solution.
Kind regards,
Joost
Hi Joost,
Thanks for getting back to me.
The github link 404 errored for me.
I understand that this is something that you are developing but the wooccomerce csv import already has zettle_sync_visibility as a taxonomy that can be used to map when importing data. So I guess I was just looking for what the value in the mapped data would need to be in order to place the product in the zettle_sync_visibility taxonomy. It would normally be a value like yes, 1 or something like that.
Thanks
Gary
Hello @garyjh28
ah yes, it’s not public, sorry about that.
This is the full code:
<?php
declare(strict_types=1);
namespace Inpsyde\Zettle\Sync\Cli;
use Inpsyde\Queue\Queue\Job\Context;
use Inpsyde\Queue\Queue\Job\EphemeralJobRepository;
use Inpsyde\Queue\Queue\Job\Job;
use Psr\Log\LoggerInterface;
class ExcludeCommand
{
/**
* @var Job
*/
private $deleteProductJob;
/**
* @var Job
*/
private $unlinkProductJob;
/**
* @var LoggerInterface
*/
private $logger;
/**
* ExcludeCommand constructor.
*
* @param Job $deleteProductJob
* @param Job $unlinkProductJob
* @param LoggerInterface $logger
*/
public function __construct(
Job $deleteProductJob,
Job $unlinkProductJob,
LoggerInterface $logger
) {
$this->deleteProductJob = $deleteProductJob;
$this->unlinkProductJob = $unlinkProductJob;
$this->logger = $logger;
}
/**
* Exclude a product locally and remotely at the Zettle Backoffice
*
* ## OPTIONS
*
* <id>
* : The WC_Product ID
*
* ## EXAMPLES
*
* wp zettle exclude product
*
* @when after_wp_load
*/
public function product(array $args, array $assocArgs)
{
$productId = (int) $args[0];
$this->deleteProductJob->execute(
Context::fromArray(
[
'productId' => $productId,
]
),
new EphemeralJobRepository(),
$this->logger
);
$this->unlinkProductJob->execute(
Context::fromArray(
[
'localId' => $productId,
]
),
new EphemeralJobRepository(),
$this->logger
);
}
}
Hi Joost,
I’ve figured this out for myself – and for all future requests for support regarding bulk exclude from sync setting when uploading products.
When using Woocommerce CSV Import Suite to upload products in bulk, Woocommerce allows you to map the zettle_sync_visibility taxonomy to data in the csv file.
The value in the CSV file must be set to zettle-excluded.
So in the CSV sheet that has all the products to be imported, there should be a custom column with a header like “Zettle Sync” for example. Next to each product that is to be excluded from the sync, the value zettle-excluded must be inserted in the “Zettle Sync” column.
When using the import suite, the zettle_sync_visibility taxonomy in the dropdown list should then be mapped to the “Zettle Sync” column (or whatever column name has been chosen to have the zettle-excluded value).
When the import takes place, the checkbox for Exclude from Sync? under Product Library Sync will be checked for all products that had the zettle-excluded value.
I’ve sucessfully done this in bulk for 1500 products.
Hello @garyjh28
that sounds very interesting, however, when I tried to reproduce this process, I was not able to successfully get any product imported with the “exclude from sync?” value populated.
Would it be possible for you to do a quick screen recording of the actions you perform in order to get this outcome? We do get this request more often and I would like to make it available in our general documentation.
If you want to just provide more details or get in direct contact with us, you can do that via these instructions.
Thank you in advance for anything you can do to help us get the same result as you did.
Kind regards,
Joost