This file contains hidden or 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 | |
| function shopp_product_update_variants ( array $variants, array $data ) { | |
| $table = DatabaseObject::tablename(Price::$table); | |
| $refresh_summaries = ProductSummary::$_updates; | |
| DB::query("UPDATE $table SET price='{$data['price']},modified='$refresh_summaries' WHERE id IN(' . join(',', $variants) . ')"); | |
| } |
This file contains hidden or 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 function send ( $data, $resource = '' ) { | |
| $request = http_build_query($data); | |
| $apiurl = str_true($this->settings['testmode']) ? self::DEVURL : self::APIURL; | |
| $url = array($apiurl, self::APIVERSION, $resource); | |
| $options = array( | |
| 'headers' => array('Authorization' => 'Basic ' . base64_encode($this->settings['apikey'] . ':')) | |
| ); | |
This file contains hidden or 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 | |
| function freebie () { | |
| if ( $this->Cart->orderisfree() ) { | |
| $this->processor = 'FreeOrder'; | |
| $this->processor($this->processor); | |
| $this->Billing->cardtype = __('Free Order','Shopp'); | |
| } elseif ( 'FreeOrder' == $this->processor ) { | |
| // If the order is not free, but the order processor is still set to free order, | |
| // reset the processor to use the default |
This file contains hidden or 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
| $products = self::$products; | |
| $quantities = array(1, 8, 6, 12); | |
| $items = array(); | |
| foreach ( $products as $i => $Product ) { | |
| $Item = new Item ( $Product, false ); | |
| $Item->quantity( $quantities[$i] ); | |
| $items[ $Item->fingerprint() ] = $Item; | |
| } | |
| ShoppOrder()->Cart->populate($items); |
This file contains hidden or 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 ( $products as $i => $Product ) { | |
| $quantity = ( $i % 2 ) ? 1 : ($i % count($products) + 1) * ($i % 3 + 1) ; | |
| $Item = new Item ( $Product, false ); | |
| $Item->quantity( $i + $quantity ); | |
| $items[ $Item->fingerprint() ] = $Item; | |
| } | |
| ShoppOrder()->Cart->populate($items); |
This file contains hidden or 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 | |
| $products = self::$products; | |
| $items = array(); | |
| for ($i = 0; $i < ( 2 * count($products) ); $i++ ) { | |
| $p = $i % count($products); | |
| if ( isset($items[$p]) ) $items[$p]->quantity($items[$p]->quantity + ($p + 1) * ($i % 3 + 1) ); | |
| else { | |
| $items[$p] = new Item($products[$p], false); | |
| $items[$p]->quantity($i + 1); | |
| } |
This file contains hidden or 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 | |
| /** | |
| * PackagingTests | |
| * | |
| * | |
| * @author John Dillick | |
| * @version 1.0 | |
| * @copyright Ingenesis Limited, 6 April, 2011 | |
| * @package | |
| **/ |
This file contains hidden or 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
| diff --git a/core/flow/Categorize.php b/core/flow/Categorize.php | |
| index 71addec..89ca8c9 100644 | |
| --- a/core/flow/Categorize.php | |
| +++ b/core/flow/Categorize.php | |
| @@ -423,7 +423,11 @@ class Categorize extends AdminController { | |
| $meta = array('spectemplate','facetedmenus','variations','pricerange','priceranges','specs','options','prices'); | |
| $metadata = array_filter_keys($_POST,$meta); | |
| foreach ($metadata as $name => $data) { | |
| - if (!isset($Category->meta[$name])) new MetaObject(); | |
| + if ( ! isset($Category->meta[ $name ]) ) { |
This file contains hidden or 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
| const PROCESS = 'checkout'; | |
| public static function submitted () { | |
| return isset($_POST[ self::PROCESS ]) && 'process' == $_POST[ self::PROCESS ]; | |
| } | |
| if ( ! self::submitted() ) return; |
This file contains hidden or 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 | |
| $address = '125-S Main St'; | |
| $number = ''; $firstword = ''; $count = 1; | |
| sscanf($address, '%d-%s', $number, $firstword); | |
| if ( ! empty($number) && ! empty($firstword) ) | |
| $address = str_replace('-', '', $address, $count); | |
| echo $address; |