How to identify a customer that is not logged in on shopify

How to identify a customer that is not logged in on shopify

You can use this code snippet to display different content on the site based on whether the user is logged in or not. Great for wholesale customers. {%- if customer.id == null -%} <div class="product-retail-link"><a href="#">Your text...

Discount Coupon Product Exceptions

Discount Coupon Product Exceptions

In xcart 4 the dscount coupon will discount all products. But in some cases you want to stop it discounting some products and not be part of the offer. This can be done using the following instructions.

Mass Delete all customers for test server purposes in xcart 4

Mass Delete all customers for test server purposes in xcart 4

Create a file in /admin/ called delete_all_customers.adhoc.php and add the following to it. define('IS_MULTILANGUAGE', 1); require './auth.php'; require $xcart_dir.'/include/security.php'; x_load('backoffice'); $customers_sql = "select id from $sql_tbl[customers]...

How to clear down a log file on linux

How to clear down a log file on linux

if you need to clear down a log file on linux as it is getting too big. Rather than delete and allow the application to re-create it. You can use the following command which will not interupt the program using it. cat /dev/null > /path/to/logfile # to empty all the...

Using GREP to search for a file using a string

Using GREP to search for a file using a string

This command will search in the recursively in the includes folder for any file type which contains the string “string_to_find” in its content. This will not find the string in filenames.

Changes to address fields and layout in OPC – X-Cart 4

Changes to address fields and layout in OPC – X-Cart 4

Looking to edit the order of the fields or even introducing new fields on the customer profile. You can do this by following this guide. The initial order of the fields is set in the "init.php" script ($default_address_book_fields array). Further the fields are cached...

Count Files Recursively using find

Count Files Recursively using find

In order to count files recursively on Linux, you have to use the “find” command and pipe it with the “wc” command in order to count the number of files. $ find <directory> -type f | wc -l

Enabling Benchmark Trace on X-Cart 4

Enabling Benchmark Trace on X-Cart 4

This feature allows you to see how long each PHP or MYSQL command is taking to run on a page load. It allows you to easily pinpoint which part of the code is the major headache. //Speed Optimization if (!empty($debug) OR !empty($_GET['debug'])) { define('BENCH',...