This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Cloud load balancer sets these for us so we know we're secure, | |
* preventing LemonStand from performing a redirect loop. | |
**/ | |
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) | |
{ | |
$_SERVER['HTTPS'] = 'on'; | |
$_SERVER['SERVER_PORT'] = 443; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function list_unique_values_in_category($name, $category = NULL) | |
{ | |
$category = (int) $category; | |
$values = Db_DbHelper::scalarArray(' | |
SELECT DISTINCT value, t4.name | |
FROM shop_product_properties t1 | |
LEFT JOIN shop_products_categories t3 | |
ON t1.product_id = t3.shop_product_id | |
LEFT JOIN shop_categories t4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$default_method = Shop_ShippingOption::find_by_api_code('default'); | |
Shop_CheckoutData::set_shipping_method($default_method->id); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach($product->option_matrix_records as $option) { | |
foreach($option->images as $image) { | |
echo $image->getPath(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t3.name, t3.sku, t3.price, count(t1.shop_product_id) AS "Number of orders" | |
FROM shop_order_items t1 | |
LEFT JOIN shop_orders t2 | |
ON t1.shop_order_id = t2.id | |
LEFT JOIN shop_products t3 | |
ON t1.shop_product_id = t3.id | |
WHERE t2.payment_processed != '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.my-lemonstand-site.com/?show_page_structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t2.name AS 'Country name', ROUND(AVG(t1.shipping_quote), 2) AS 'Average shipping price' | |
FROM shop_orders t1 | |
LEFT JOIN shop_countries t2 | |
ON t1.shipping_country_id = t2.id | |
WHERE t1.status_id != 1 | |
GROUP BY(t2.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t2.sku, t2.name, t2.price, SUM(t1.quantity) | |
FROM shop_order_items t1 | |
LEFT JOIN shop_products t2 | |
ON t1.shop_product_id = t2.id | |
GROUP BY t2.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t2.id, t2.sku, t2.name, t2.price | |
FROM shop_products t2 | |
WHERE NOT EXISTS (SELECT * FROM shop_order_items t1 WHERE t1.shop_product_id=t2.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print_r( Phpr_SecurityFramework::create()->get_config_content() ); | |
?> |
OlderNewer