Example #1
0
 public function view()
 {
     $this->set("itemCount", StoreCart::getTotalItemsInCart());
     $this->set("total", StorePrice::format(StoreCalculator::getSubTotal()));
     $js = \Concrete\Package\VividStore\Controller::returnHeaderJS();
     $this->requireAsset('javascript', 'jquery');
     $this->addFooterItem($js);
     $this->requireAsset('javascript', 'vivid-store');
     $this->requireAsset('css', 'vivid-store');
 }
Example #2
0
 public static function getTaxes($format = false)
 {
     $taxRates = self::getTaxRates();
     $taxes = array();
     if (count($taxRates) > 0) {
         foreach ($taxRates as $taxRate) {
             if ($taxRate->isTaxable()) {
                 $taxAmount = $taxRate->calculate();
                 if ($taxAmount > 0) {
                     $tax = true;
                 } else {
                     $tax = false;
                 }
                 if ($format == true) {
                     $taxAmount = StorePrice::format($taxAmount);
                 }
                 $taxes[] = array('name' => $taxRate->getTaxLabel(), 'taxamount' => $taxAmount, 'based' => $taxRate->getTaxBasedOn(), 'taxed' => $tax);
             }
         }
     }
     return $taxes;
 }
Example #3
0
 public function getShippingTotal()
 {
     $smID = $_POST['smID'];
     echo StorePrice::format(StoreCalculator::getShippingTotal($smID));
 }
Example #4
0
 public function view()
 {
     $this->set("itemCount", StoreCart::getTotalItemsInCart());
     $this->set("total", StorePrice::format(StoreCalculator::getSubTotal()));
 }
Example #5
0
}
//if cart
?>
        </ul>


        <?php 
if ($cart && !empty($cart)) {
    ?>
        <div class="cart-page-cart-total">
            <span class="cart-grand-total-label"><?php 
    echo t("Sub Total");
    ?>
:</span>
            <span class="cart-grand-total-value"><?php 
    echo StorePrice::format($total);
    ?>
</span>
        </div>
        <?php 
} else {
    ?>
        <p class="alert alert-info"><?php 
    echo t('Your cart is empty');
    ?>
</p>
        <?php 
}
?>

Example #6
0
                        </a>
                    </div>
                    <div class="checkout-cart-product-name">
                        <a href="<?php 
            echo URL::page(Page::getByID($product->getProductPageID()));
            ?>
">
                        <?php 
            echo $product->getProductName();
            ?>
                        </a>
                    </div>

                    <div class="checkout-cart-item-price">
                        <?php 
            echo Price::format($product->getProductPrice());
            ?>
                    </div>
                    <div class="checkout-cart-product-qty">
                        <span class="checkout-cart-item-label"><?php 
            echo t("Quantity:");
            ?>
</span>
                        <?php 
            echo $qty;
            ?>
                    </div>

                    <?php 
            if ($cartItem['productAttributes']) {
                ?>
Example #7
0
 public function getDisplay()
 {
     $display = trim($this->drDisplay);
     if ($display) {
         return $display;
     } else {
         if ($this->drDeductType == 'percentage') {
             return $this->drPercentage . ' ' . t('off');
         }
         if ($this->drDeductType == 'value') {
             return StorePrice::format($this->drValue) . ' ' . t('off');
         }
     }
 }
Example #8
0
 public function getTotal()
 {
     echo Price::format(VividCart::getTotal());
 }
Example #9
0
 public function getFormattedPrice()
 {
     return Price::format($this->pPrice);
 }
Example #10
0
			<td><?php 
    echo Price::format($o->getShippingTotal());
    ?>
</td>
			<td>
				<?php 
    $tax = $o->getTaxTotal();
    $includedTax = $o->getIncludedTaxTotal();
    if ($tax) {
        echo Price::format($tax);
    } elseif ($includedTax) {
        echo Price::format($includedTax);
    }
    ?>
			</td>
			<td><?php 
    echo Price::format($o->getTotal());
    ?>
</td>
		</tr>
		<?php 
}
?>
	</tbody>
</table>
<?php 
if ($paginator->getTotalPages() > 1) {
    ?>
    <?php 
    echo $pagination;
}
Example #11
0
        $checked = true;
    } else {
        if ($i == 1) {
            $checked = true;
        } else {
            $checked = false;
        }
    }
    ?>
    <div class="radio">
        <label>
            <input type="radio" name="shippingMethod" value="<?php 
    echo $method->getShippingMethodID();
    ?>
"<?php 
    if ($checked) {
        echo " checked";
    }
    ?>
>
            <?php 
    echo $method->getName();
    ?>
 - <?php 
    echo StorePrice::format($method->getShippingMethodTypeMethod()->getRate());
    ?>
        </label>
    </div>
<?php 
    $i++;
}
Example #12
0
 public function getFormattedVariationPrice()
 {
     return StorePrice::format($this->pvPrice);
 }
Example #13
0
                        </a>
                    </div>
                    <div class="checkout-cart-product-name">
                        <a href="<?php 
            echo URL::page(Page::getByID($product->getProductPageID()));
            ?>
">
                        <?php 
            echo $product->getProductName();
            ?>
                        </a>
                    </div>

                    <div class="checkout-cart-item-price">
                        <?php 
            echo Price::format($product->getActivePrice());
            ?>
                    </div>

                    <?php 
            if ($product->allowQuantity()) {
                ?>
                    <div class="checkout-cart-product-qty">
                        <span class="checkout-cart-item-label"><?php 
                echo t("Quantity:");
                ?>
</span>
                        <?php 
                echo $qty;
                ?>
                    </div>
Example #14
0
 public function getShippingTotal()
 {
     $smID = $_POST['smID'];
     echo Price::format(VividCart::getShippingTotal($smID));
 }
Example #15
0
 public function view()
 {
     $this->set("itemCount", VividCart::getTotalItemsInCart());
     $this->set("total", Price::format(VividCart::getSubTotal()));
 }
Example #16
0
        //if is_object
        $i++;
    }
    //foreach
}
//if cart
?>
    </ul>
    
    <div class="cart-page-cart-total">        
        <span class="cart-grand-total-label"><?php 
echo t("Sub Total");
?>
:</span>
        <span class="cart-grand-total-value"><?php 
echo Price::format($total);
?>
</span>
    </div>
        
    <div class="cart-page-cart-links">
        <?php 
if ($cart && !empty($cart)) {
    ?>
        <a class="btn-cart-page-clear" href="javascript:vividStore.clearCart()"><?php 
    echo t('Clear Cart');
    ?>
</a>
        <a class="btn-cart-page-checkout" href="<?php 
    echo View::url('/checkout');
    ?>
Example #17
0
 public function getFormattedActivePrice()
 {
     return StorePrice::format($this->getActivePrice());
 }
Example #18
0
        echo View::url('/dashboard/store/orders/order/', $order->getOrderID());
        ?>
"><?php 
        echo $order->getOrderID();
        ?>
</a></td>
                    <td><?php 
        echo $order->getAttribute('billing_last_name') . ", " . $order->getAttribute('billing_first_name');
        ?>
</td>
                    <td><?php 
        echo $order->getOrderDate();
        ?>
</td>
                <td><?php 
        echo Price::format($order->getTotal());
        ?>
</td>
                    <td><?php 
        echo ucwords($order->getStatus());
        ?>
</td>
                    <td><a class="btn btn-primary" href="<?php 
        echo View::url('/dashboard/store/orders/order/', $order->getOrderID());
        ?>
"><?php 
        echo t("View");
        ?>
</a></td>
                </tr>
            <?php 
Example #19
0
	</thead>
	<tbody>
		<?php 
foreach ($products as $product) {
    ?>
		<tr>
			<td><?php 
    echo $product['name'];
    ?>
</td>
			<td><?php 
    echo $product['quantity'];
    ?>
</td>
			<td><?php 
    echo Price::format($product['pricePaid']);
    ?>
</td>
		</tr>
		<?php 
}
?>
	</tbody>
</table>

<?php 
if ($paginator->getTotalPages() > 1) {
    ?>
    <?php 
    echo $pagination;
}