function cart_content($content) { $cart_preview = new CartPreview(); if (get_the_ID() == get_option('cart_page_id') and is_singular() and in_the_loop()) { $content = $cart_preview->get_cart(); } return $content; }
* @package wp-olivecart */ require_once dirname(__FILE__) . "/../conf/user_conf.php"; require_once dirname(__FILE__) . "/../conf/php_ini_set.php"; require_once dirname(__FILE__) . '/../lib/db_access.php'; require_once dirname(__FILE__) . '/../lib/error_check.php'; require_once dirname(__FILE__) . '/../conf/form_conf.php'; require_once dirname(__FILE__) . '/../lib/cart/send_mail.php'; require_once dirname(__FILE__) . "/../lib/db_access2.php"; require_once dirname(__FILE__) . "/../lib/zipcode.php"; require_once dirname(__FILE__) . '/../lib/cart/session_connect.php'; #require_once( dirname(__FILE__)."/../lib/mypage/my-page.php"); require_once dirname(__FILE__) . "/../lib/mypage/cookie_check.php"; /* $Id: cart.php 2013-10-26 15:10:03 $ */ #require_once( dirname(__FILE__)."/../lib/cart/cart_step.php"); $cart_preview = new CartPreview(); if (!is_admin()) { $cart_preview->get_pasonaldata(); } add_filter('the_title', 'cart_title'); function cart_title($title) { if (get_the_ID() == get_option('cart_page_id') and is_singular() and in_the_loop()) { $title = get_cart_title(); } return $title; } function get_cart_title() { //change page title switch ($_REQUEST['step']) {
<?php /**Shopping Cart System Olive-Cart. * @link http://www.wp-olivecart.com/ * @copyright 2008-2012 Olive-Design, Corp. * @package Olive-Cart */ /* $Id: cart.php 2009-02-12 15:10:03 $ */ require_once dirname(__FILE__) . '/../../../wp-config.php'; require_once dirname(__FILE__) . '/cart/cart.php'; if ($_POST['step'] != 1) { $page_id = get_option('cart_page_id'); $url = get_option('siteurl') . "?page_id={$page_id}"; header("Location: " . $url . ""); exit; } else { $cart_preview = new CartPreview(); $cart_preview->get_cart(); }
public function testCartPreviewWithDiscount() { $cart_srl = 774; $module_srl = 107; // Configure shop to use discounts $args = new stdClass(); $args->module_srl = $module_srl; $args->discount_min_amount = 10; $args->discount_type = 'fixed_amount'; $args->discount_amount = 5; $output = executeQuery('shop.updateDiscountInfo',$args); if(!$output->toBool()) { throw new Exception($output->getMessage()); } // Test that cart preview has discount $cart = new Cart($cart_srl); $cart_preview = new CartPreview($cart); $this->assertEquals($cart->getDiscountAmount(), $cart_preview->getDiscountAmount()); }