Skip to content

Instantly share code, notes, and snippets.

View KittenCodes's full-sized avatar

Phe Simmonds KittenCodes

View GitHub Profile
<?php
/*
################### READ ME #################################
You must create a proxy file that retrieves your import file from FTP and then returns it.
You will then call that file with the 'Download from URL' option in WP All Import.
This is an example of such a proxy file. This is provided in the hopes it is useful, but without any support.
###############################################################
Instructions:
* Copy the code below to a new php file in the root of your WP site
* Update the FTP server details
@KittenCodes
KittenCodes / delete_empty_export.php
Last active March 20, 2019 16:39
Delete empty export files created by WP All Import
<?php
/*
################### READ ME #################################
Hooks into pmxe_after_export and deletes the export files if no posts were found.
This is provided in the hopes it is useful, but without any support.
###############################################################
Instructions:
The code needs to be added to your theme functions.php or by using a plugin like Code Snippets:
https://wordpress.org/plugins/code-snippets/
###############################################################
@KittenCodes
KittenCodes / Import Types.md
Last active September 29, 2019 15:41
WP All Import - Import Types

A description of import types

  • New Items Import -

This is primarily used to create and manage products. It keeps internal track of the products that it imports, which means that it can later update/create/delete products as they're changed/added/removed in your import file. It's also the only import type that can add/remove variations for variable products.

One limitation of new items imports is that cannot detect/update products that it didn't previously create.

@KittenCodes
KittenCodes / updatestock.md
Last active January 28, 2019 14:02
Update stock values with WP All Import

Update WooCommerce stock levels with WP All Import

You will need an import file that contains the new stock value and the variation SKU. For this process to work correctly, your products will need to have unique SKUs.

  1. Create an "Existing Items" import to WooCommerce Products: https://d.pr/i/c5daMc
  2. On Step 3 of the import process, leave the Product Type set to Simple and add the new stock value: https://d.pr/i/iN9S5t
  3. On Step 4 of the import process, select to match on the custom field _sku and add the SKU element from your import file: https://d.pr/i/7EwWTl
  4. Also on Step 4, select to update the custom fields _stock and _manage_stock only: https://d.pr/i/qHWcxr
@KittenCodes
KittenCodes / updateprices.md
Last active November 25, 2020 23:39
Update product prices with WP All Import

Update WooCommerce product prices with WP All Import

You will need an import file that contains the new price and the variation SKU. For this process to work correctly, your products will need to have unique SKUs.

  1. Create an "Existing Items" import to WooCommerce Products: https://d.pr/i/c5daMc
  2. On Step 3 of the import process, leave the Product Type set to Simple and add the new price information: https://d.pr/i/P6XQhC
  3. On Step 4 of the import process, select to match on the custom field _sku and add the SKU element from your import file: https://d.pr/i/7EwWTl
  4. Also on Step 4, select to update the custom fields _price, _regular_price and _sale_price only: https://d.pr/i/gaXjgl
@KittenCodes
KittenCodes / updatestockprice.md
Last active January 30, 2023 06:39
Update WooCommerce Price & Stock levels with WP All Import

Update WooCommerce price & stock levels with WP All Import

You will need an import file that contains the new stock value, price information and the variation SKU. For this process to work correctly, your products will need to have unique SKUs.

  1. Create an "Existing Items" import to WooCommerce Products: https://d.pr/i/c5daMc
  2. On Step 3 of the import process, leave the Product Type set to Simple, add the new price information to the General tab (https://d.pr/i/P6XQhC) and the new stock value to the Inventory tab: https://d.pr/i/iN9S5t
  3. On Step 4 of the import process, select to match on the custom field _sku and add the SKU element from your import file: https://d.pr/i/7EwWTl
  4. Also on Step 4, select to update the custom fields _price, _regular_price, _sale_price, _stock and _manage_stock only: https://d.pr/i/c1iZm7
@KittenCodes
KittenCodes / single-event.php
Last active October 15, 2021 18:00
The Events Calendar - Single Event
<?php
$events_label_singular = tribe_get_event_label_singular();
$events_label_plural = tribe_get_event_label_plural();
$event_id = get_the_ID();
?>
<div id="tribe-events-content" class="tribe-events-single">
@KittenCodes
KittenCodes / events-archive.php
Last active March 13, 2020 20:27
The Events Calendar - Events Archive
<?php
use Tribe\Events\Views\V2\Template_Bootstrap;
echo tribe( Template_Bootstrap::class )->get_view_html();
?>
@KittenCodes
KittenCodes / event-popup.php
Created November 24, 2019 10:39
The Events Calendar - Event Popup
function tribe_add_gridview_class( $classes ) {
if ( is_post_type_archive( 'tribe_events' ) && tribe_is_month()) {
$classes[] = 'events-gridview';
return $classes;
} else {
$classes[] = '';
return $classes;
}
}
add_filter( 'body_class', 'tribe_add_gridview_class', 999 );
@KittenCodes
KittenCodes / events-archive.css
Created February 6, 2020 09:17
The Events Calendar - Events Archive
.ct-code-block .tribe-common--breakpoint-medium.tribe-events .tribe-events-l-container {
padding: 0;
}