Skip to content

Instantly share code, notes, and snippets.

View krisives's full-sized avatar
🤣

Kristopher Ives krisives

🤣
  • United States
View GitHub Profile
/**
* wpsc_product_variation_price_available function
* Checks for the lowest price of a products variations
*
* @return $price (string) number formatted price
*/
function wpsc_product_variation_price_available( $product_id, $from_text = false, $only_normal_price = false ){
global $wpdb;
$joins = array(
"INNER JOIN {$wpdb->postmeta} AS pm ON pm.post_id = p.id AND pm.meta_key = '_wpsc_price'",
@krisives
krisives / gist:2931711
Created June 14, 2012 17:45
Fernando's generateDiv() function ...
function generateDiv( $product_id, $product_name, $product_s_desc, $img_div, $title_div, $desc_div, $display_image, $display_title, $display_desc ){
global $sess, $VM_LANG, $mm_action_url;
STN::depend('ProductImage');
require_once CLASSPATH.'ps_product_category.php';
$ps_product_category = new ps_product_category;
$cid = $ps_product_category->get_cid( $product_id );
$url = "?page=shop.product_details&category_id=$cid";
@krisives
krisives / gist:4237686
Created December 8, 2012 00:03
Clean Verbose PHP Logs when buried in layers of CGI
<?
// Remove lots of crap from logs easily
while (($line = fgets(STDIN)) !== false) {
$line = trim($line);
$line = preg_replace('#^\[[^\]]+\] \[[^\]]+\] \[[^\]]+\] [^\:]+\: [^\:]+\:#i', '', $line);
$line = trim($line);
if (strlen($line) <= 0) {
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<update>
<product>
<product_name>Test 2</product_name>
<product_sku>4587</product_sku>
</product>
</update>
An update script has detected files that
do not exist and cannot be found. Please
review the problems below and correct
them or forward this e-mail to someone who
can.
This e-mail will not be sent again for these
images and once fixed they need to have the
`file_is_broken` flag cleared from them in
the jos_vm_product_files table:
RewriteEngine On # Enable the rewrite engine
RewriteBase /new-site-setup # Assuming this .htaccess is in /new-site-setup
RewriteRule ^Table/Training-Sessions/Site-Set-Up site-setup [L]
"Old Site URL","New Site SEF URL"
"http://stoysnet.com/stnhelp/index.php/Table/Training-Sessions/Site-Set-Up/","http://help.stoysnet.com/new-site-setup/site-setup"
"http://stoysnet.com/stnhelp/index.php/Training-Sessions/Site-Set-Up/1-Contact-Us-Page-info.html","http://help.stoysnet.com/new-site-setup/site-setup/contact-us-page-info.html"
"http://stoysnet.com/stnhelp/index.php/Training-Sessions/Site-Set-Up/2-Store-Info-for-shopping-cart.html","http://help.stoysnet.com/new-site-setup/site-setup/store-info-for-shopping-cart.html"
"http://stoysnet.com/stnhelp/index.php/Training-Sessions/Site-Set-Up/3-Sales-Tax-setup.html","http://help.stoysnet.com/new-site-setup/site-setup/sales-tax-setup.html"
"http://stoysnet.com/stnhelp/index.php/Training-Sessions/Site-Set-Up/4-Configure-your-Shipping.html","http://help.stoysnet.com/new-site-setup/site-setup/configure-your-shipping.html"
"http://stoysnet.com/stnhelp/index.php/Training-Sessions/Site-Set-Up/5-Store-Policy-pages.html","http://help.stoysnet.com/site-setup/store-p
RewriteRule ^Table/Training-Sessions/Site-Set-Up$ new-site-setup/site-setup [L]
RewriteRule ^Training-Sessions/Site-Set-Up/1-Contact-Us-Page-info.html$ new-site-setup/site-setup/contact-us-page-info.html [L]
RewriteRule ^Training-Sessions/Site-Set-Up/2-Store-Info-for-shopping-cart.html$ new-site-setup/site-setup/store-info-for-shopping-cart.html [L]
RewriteRule ^Training-Sessions/Site-Set-Up/3-Sales-Tax-setup.html$ new-site-setup/site-setup/sales-tax-setup.html [L]
RewriteRule ^Training-Sessions/Site-Set-Up/4-Configure-your-Shipping.html$ new-site-setup/site-setup/configure-your-shipping.html [L]
RewriteRule ^Training-Sessions/Site-Set-Up/5-Store-Policy-pages.html$ site-setup/store-policy-pages.html [L]
RewriteRule ^Training-Sessions/Site-Set-Up/6-Shopping-Cart-Configuration.html$ new-site-setup/site-setup/shopping-cart-configuration.html [L]
RewriteRule ^Training-Sessions/Site-Set-Up/7-Choose-your-Payment-Methods.html$ new-site-setup/site-setup/choose-your-payment-methods.html [L]
RewriteRule ^Store-Info.htm
demo 3
toyopwis 3
startoys 2
le039 2
barstons 2
cheekymt 2
dragonfly 2
kidscent 2
grtoysco 2
henrybea 2
I did an update and see that all of the items with no quantity threw errors. Since I think they all had 0 quantity previously does that mean that the errors are thrown if the quantity I’m trying to adjust to is the same as the previous quantity? This was a full update. Future updates will include anything that has changed since the last update, but the price and quantity may be the same as the previous run. I have no way of knowing if she changed the name, a description or what so we just send an update if the last modified time has changed for any reason. I’ve attached the logs created by our integration tool if they’ll help. They include the text of the fault that I got back from the web service.