Skip to content

Instantly share code, notes, and snippets.

// http:// url strony /wp-admin/admin-ajax.php?action=process_product
add_action('wp_ajax_process_product', 'process_all_products');
function process_all_products()
{
$args = array(
'return' => 'ids'
);
$products = wc_get_products($args);
echo count($products).'<br/>';
foreach ($products as $productID) {
@piotrh
piotrh / Response.php
Created June 25, 2019 09:14 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@piotrh
piotrh / README.md
Created January 26, 2018 08:16 — forked from Alymosul/README.md
[Laravel] Seeding data in testing as part of the application build.

SeedDatabase trait along with SeedDatabaseState class gives your Laravel project the ability to seed the testing database once before running the full suite tests, which improves the speed of the tests than seeding the testing database before each test.

Also, it has the option to run custom seeders instead of the seeders that are called in the run() method of the DatabaseSeeder class you can achieve that as follows

...in the Testcase.php

public function setUp()

{