Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/Admin/Notes
File: MigrateFromShopify.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WooCommerce Admin: Migrate from Shopify to WooCommerce.
[2] Fix | Delete
*
[3] Fix | Delete
* Adds a note to ask the client if they want to migrate from Shopify to WooCommerce.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
namespace Automattic\WooCommerce\Internal\Admin\Notes;
[7] Fix | Delete
[8] Fix | Delete
defined( 'ABSPATH' ) || exit;
[9] Fix | Delete
[10] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\Note;
[11] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\NoteTraits;
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Migrate_From_Shopify.
[15] Fix | Delete
*/
[16] Fix | Delete
class MigrateFromShopify {
[17] Fix | Delete
/**
[18] Fix | Delete
* Note traits.
[19] Fix | Delete
*/
[20] Fix | Delete
use NoteTraits;
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Name of the note for use in the database.
[24] Fix | Delete
*/
[25] Fix | Delete
const NOTE_NAME = 'wc-admin-migrate-from-shopify';
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Get the note.
[29] Fix | Delete
*
[30] Fix | Delete
* @return Note
[31] Fix | Delete
*/
[32] Fix | Delete
public static function get_note() {
[33] Fix | Delete
[34] Fix | Delete
// We want to show the note after two days.
[35] Fix | Delete
$two_days = 2 * DAY_IN_SECONDS;
[36] Fix | Delete
if ( ! self::is_wc_admin_active_in_date_range( 'week-1', $two_days ) ) {
[37] Fix | Delete
return;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
[41] Fix | Delete
if (
[42] Fix | Delete
! isset( $onboarding_profile['setup_client'] ) ||
[43] Fix | Delete
! isset( $onboarding_profile['selling_venues'] ) ||
[44] Fix | Delete
! isset( $onboarding_profile['other_platform'] )
[45] Fix | Delete
) {
[46] Fix | Delete
return;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
// Make sure the client is not setup.
[50] Fix | Delete
if ( $onboarding_profile['setup_client'] ) {
[51] Fix | Delete
return;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
// We will show the notification when the client already is selling and is using Shopify.
[55] Fix | Delete
if (
[56] Fix | Delete
'other' !== $onboarding_profile['selling_venues'] ||
[57] Fix | Delete
'shopify' !== $onboarding_profile['other_platform']
[58] Fix | Delete
) {
[59] Fix | Delete
return;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
$note = new Note();
[63] Fix | Delete
$note->set_title( __( 'Do you want to migrate from Shopify to WooCommerce?', 'woocommerce' ) );
[64] Fix | Delete
$note->set_content( __( 'Changing eCommerce platforms might seem like a big hurdle to overcome, but it is easier than you might think to move your products, customers, and orders to WooCommerce. This article will help you with going through this process.', 'woocommerce' ) );
[65] Fix | Delete
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
[66] Fix | Delete
$note->set_name( self::NOTE_NAME );
[67] Fix | Delete
$note->set_content_data( (object) array() );
[68] Fix | Delete
$note->set_source( 'woocommerce-admin' );
[69] Fix | Delete
$note->add_action(
[70] Fix | Delete
'migrate-from-shopify',
[71] Fix | Delete
__( 'Learn more', 'woocommerce' ),
[72] Fix | Delete
'https://woocommerce.com/posts/migrate-from-shopify-to-woocommerce/?utm_source=inbox&utm_medium=product',
[73] Fix | Delete
Note::E_WC_ADMIN_NOTE_ACTIONED
[74] Fix | Delete
);
[75] Fix | Delete
return $note;
[76] Fix | Delete
}
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function