Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/com_digicom/admin/helpers/digicom.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ public static function renderSidebar(){

}

public static function format_price ($amount, $ccode, $add_sym = true, $configs, $decial = null)
public static function format_price ($amount, $ccode, $add_sym, $configs, $decial = null)
{
if(empty($add_sym)){
$add_sym = true;
}

if($decial === NULL){
$decial = $configs->get('decimaldigits','2');
}
Expand Down
5 changes: 4 additions & 1 deletion src/com_digicom/site/helpers/price.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ class DigiComSiteHelperPrice {
/**
* price formet helper
*/
public static function format_price( $amount, $ccode, $add_sym = false, $configs )
public static function format_price( $amount, $ccode, $add_sym, $configs )
{
if(empty($add_sym)){
$add_sym = false;
}

$currency_use = $configs->get('currency_use','symbol');
$currency_symbol = $configs->get('currency_symbol','$');
Expand Down
14 changes: 12 additions & 2 deletions src/com_digicom/site/models/cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,10 @@ function updateOrder($order_id, $result, $data, $pay_plugin, $status, $items, $c
$type = 'process_order';
if($status != 'Refund')
{
$orderTable->amount_paid = $orderTable->amount_paid + $data['total_paid_amt'];
if((float)$data['total_paid_amt']>0){
$orderTable->amount_paid = (float)$orderTable->amount_paid + (float)$data['total_paid_amt'];
}
$orderTable->amount_paid = (float)$orderTable->amount_paid;
}
else{
// as refund, check if has refund amout else all
Expand Down Expand Up @@ -1114,8 +1117,15 @@ function goToSuccessURL( $sid, $msg = '', $orderid = 0 , $type = 'new_order')

}

function getFinalize( $sid, $msg = '', $orderid = 0 , $type, $status)
function getFinalize( $sid, $msg, $orderid, $type, $status)
{
if(empty($orderid)){
$orderid = 0;
}

if(empty($msg)){
$msg = "";
}
global $Itemid;

$conf = $this->getInstance( "config", "digicomModel" );
Expand Down
3 changes: 2 additions & 1 deletion src/com_digicom/site/models/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ protected function getStoreId($id = '')
*/
public function getItems()
{
if (!count($this->_items))
// dd($this->_items);
if (empty($this->_items))
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
Expand Down
5 changes: 3 additions & 2 deletions src/com_digicom/site/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function build(&$query)
{
// there are no menu Itemid found, lets dive into menu finder
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view='.$view, true);
//print_r($menuItem);die;
if(!is_null($menuItem) && count($menuItem)){
// dd($menuItem);

if(!is_null($menuItem)){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
}else{
Expand Down
7 changes: 4 additions & 3 deletions src/com_digicom/site/views/category/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function display($tpl = null)
$this->category->event->afterDisplayContent = trim(implode("\n", $results));

// Compute the product slugs and prepare introtext (runs content plugins).
if(count($this->items))
if(!empty($this->items) && count($this->items))
{
foreach ($this->items as $item)
{
Expand Down Expand Up @@ -267,12 +267,13 @@ protected function prepareDocument()
$path = array(array('title' => $this->category->title, 'link' => ''));
$category = $this->category->getParent();
if(!empty($category)){
while (($menu->query['option'] != 'com_digicom' || $menu->query['view'] == 'product' || $id != $category->id) && $category->id > 1)


while (($menu->query['option'] != 'com_digicom' || $menu->query['view'] == 'product' || !empty($category->id) && $id != $category->id) && $category->id > 1)
{
$path[] = array('title' => $category->title, 'link' => DigiComSiteHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}

}

$path = array_reverse($path);
Expand Down
3 changes: 1 addition & 2 deletions src/com_digicom/site/views/product/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ protected function _prepareDocument()
$category = $category->getParent();

if($currentTemplate) continue;

$catParams = new Registry;
$catParams->loadString($category->getParams());
$catParams->loadString($category->params ?? '{}');

$category_layout = $catParams->get('category_layout','');
if(!empty($category_layout)){
Expand Down
23 changes: 20 additions & 3 deletions src/plg_digicom_pay_paypal/paypal/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ class plgDigiCom_PayPaypalHelper
* @secure_post = if you want https
* @sandbox = if you use sandbox or demo or dev mode
*/
public static function buildPaymentSubmitUrl($secure_post = true, $sandbox = false)
public static function buildPaymentSubmitUrl($secure_post, $sandbox)
{
if(empty($secure_post)){
$secure_post = true;
}

if(empty($sandbox)){
$sandbox = false;
}

$url = $sandbox ? 'www.sandbox.paypal.com' : 'www.paypal.com';
if ($secure_post) {
$url = 'https://'.$url.'/cgi-bin/webscr';
Expand Down Expand Up @@ -106,8 +114,13 @@ public static function Storelog($name, $data)
*
* @since 1.0.0
*/
public static function validateIPN($data, $sandbox = false, $params, $componentName = 'digicom')
public static function validateIPN($data, $sandbox, $params, $componentName = 'digicom')
{
if(empty($sandbox)){
$sandbox = false;
}


$url = plgDigiCom_PayPaypalHelper::buildIPNPaymentUrl(true, $sandbox);

// STEP 1: read POST data
Expand Down Expand Up @@ -216,8 +229,12 @@ public static function validateIPN($data, $sandbox = false, $params, $componentN
*
* @since 1.0.0
*/
public function validateIPN_x($data, $sandbox = false, $params, $componentName = 'digicom')
public function validateIPN_x($data, $sandbox, $params, $componentName = 'digicom')
{
if(empty($sandbox)){
$sandbox = false;
}

$version = new \JVersion;
$httpOption = new \Joomla\Registry\Registry;
$status = true;
Expand Down