Skip to content

Commit

Permalink
3.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PhocaCz committed May 19, 2020
1 parent 6f56995 commit ee621d0
Show file tree
Hide file tree
Showing 55 changed files with 859 additions and 103 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Phoca Cart is e-commerce extension - powerful shopping cart for Joomla! CMS. Pho

## Version

3.5.1
3.5.2



Expand Down
56 changes: 52 additions & 4 deletions admin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="image_categories_view" type="media" default="" directoryimg="1" label="COM_PHOCACART_FIELD_IMAGE_CATEGORIES_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_CATEGORIES_VIEW_DESC"/>


<!--
Expand Down Expand Up @@ -314,7 +317,8 @@
<option value="0">COM_PHOCACART_NO</option>
</field>


<field name="image_items_view" type="media" default="" directoryimg="1" label="COM_PHOCACART_FIELD_IMAGE_ITEMS_VIEW_LABEL"
description="COM_PHOCACART_FIELD_IMAGE_ITEMS_VIEW_DESC"/>


<field name="phocahead5" type="phocahead" default="COM_PHOCACART_ITEM_VIEW_LABEL" label="" description=""/>
Expand Down Expand Up @@ -514,9 +518,6 @@
<option value="3">COM_PHOCACART_YES_NEW_USERS_NEW_GUEST_USERS</option>
</field>


delivery_billing_same_enabled


<field name="phocahead30" type="phocahead" default="COM_PHOCACART_USER_ACCOUNT_VIEW_LABEL" label="" description=""/>

Expand Down Expand Up @@ -836,6 +837,16 @@
<option value="1">COM_PHOCACART_TAX_EXCLUSIVE_AMOUNT</option>
<option value="0">COM_PHOCACART_NO_TAX_AMOUNT</option>
</field>

<field name="shipping_country_rule" type="list" default="1" label="COM_PHOCACART_FIELD_COUNTRY_RULE_SHIPPING_LABEL" description="COM_PHOCACART_FIELD_COUNTRY_RULE_SHIPPING_DESC">
<option value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
</field>

<field name="shipping_region_rule" type="list" default="1" label="COM_PHOCACART_FIELD_REGION_RULE_SHIPPING_LABEL" description="COM_PHOCACART_FIELD_REGION_RULE_SHIPPING_DESC">
<option value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
</field>

<field name="tax_calculation_payment" type="list" default="0" label="COM_PHOCACART_FIELD_TAX_CALCULATION_PAYMENT_LABEL" description="COM_PHOCACART_FIELD_TAX_CALCULATION_PAYMENT_DESC">
<option value="2">COM_PHOCACART_TAX_INCLUSIVE_PRICE</option>
Expand All @@ -848,6 +859,16 @@
<option value="1">COM_PHOCACART_TAX_EXCLUSIVE_AMOUNT</option>
<option value="0">COM_PHOCACART_NO_TAX_AMOUNT</option>
</field>

<field name="payment_country_rule" type="list" default="1" label="COM_PHOCACART_FIELD_COUNTRY_RULE_PAYMENT_LABEL" description="COM_PHOCACART_FIELD_COUNTRY_RULE_PAYMENT_DESC">
<option value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
</field>

<field name="payment_region_rule" type="list" default="1" label="COM_PHOCACART_FIELD_REGION_RULE_PAYMENT_LABEL" description="COM_PHOCACART_FIELD_REGION_RULE_PAYMENT_DESC">
<option value="1">COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS</option>
<option value="2">COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS</option>
</field>

<field name="dynamic_tax_rate" type="list" default="0" label="COM_PHOCACART_FIELD_DYNAMIC_TAX_RATE_LABEL" description="COM_PHOCACART_FIELD_DYNAMIC_TAX_RATE_DESC">
<option value="1">COM_PHOCACART_ENABLE_CUSTOMER_BILLING_ADDRESS</option>
Expand Down Expand Up @@ -1486,6 +1507,33 @@
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>


<field name="phocahead38" type="phocahead" default="COM_PHOCACART_PRINTED_CATALOG_OPTIONS_LABEL" label="" description=""/>

<field name="printed_catalog_enable" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_ENABLE_CREATING_PRINTED_CATALOG_LABEL"
description="COM_PHOCACART_FIELD_ENABLE_CREATING_PRINTED_CATALOG_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>
<field name="printed_catalog_header" type="modal_article" select="true" new="true" edit="true" clear="true" class="inputbox" label="COM_PHOCACART_FIELD_PRINTED_CATALOG_HEADER_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_HEADER_DESC" addfieldpath="/administrator/components/com_content/models/fields"/>

<field name="printed_catalog_document_title" type="text" default="" label="COM_PHOCACART_FIELD_PRINTED_CATALOG_DOCUMENT_TITLE_LABEL" description="COM_PHOCACART_FIELD_PRINTED_CATALOG_DOCUMENT_TITLE_DESC" filter="string"/>

<field name="printed_catalog_css" default="" type="textarea" label="COM_PHOCACART_FIELD_PRINTED_CATALOG_CSS_LABEL" description="COM_PHOCACART_FIELD_PRINTED_CATALOG_CSS_DESC"/>

<field name="printed_catalog_display_category_title" type="radio" class="btn-group btn-group-yesno" default="1" label="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_CATEGORY_TITLE_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_CATEGORY_TITLE_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="printed_catalog_display_price_label" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_PRICE_LABEL_LABEL"
description="COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_PRICE_LABEL_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="phocahead32" type="phocahead" default="COM_PHOCACART_ADMINISTRATION_OPTIONS_LABEL" label="" description=""/>

Expand Down
33 changes: 33 additions & 0 deletions admin/language/en-GB/en-GB.com_phocacart.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,39 @@ COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO=""


;[3.5.2]
COM_PHOCACART_BASED_CUSTOMER_BILLING_ADDRESS="Based on Customer Billing Address"
COM_PHOCACART_BASED_CUSTOMER_SHIPPING_ADDRESS="Based on Customer Shipping Address"
COM_PHOCACART_FIELD_COUNTRY_RULE_SHIPPING_LABEL="Shipping Country Rule"
COM_PHOCACART_FIELD_COUNTRY_RULE_SHIPPING_DESC="Set which country (based on billing or shipping address) should be applied for shipping country rule."
COM_PHOCACART_FIELD_REGION_RULE_SHIPPING_LABEL="Shipping Region Rule"
COM_PHOCACART_FIELD_REGION_RULE_SHIPPING_DESC="Set which region (based on billing or shipping address) should be applied for shipping region rule."
COM_PHOCACART_FIELD_COUNTRY_RULE_PAYMENT_LABEL="Payment Country Rule"
COM_PHOCACART_FIELD_COUNTRY_RULE_PAYMENT_DESC="Set which country (based on billing or shipping address) should be applied for payment country rule."
COM_PHOCACART_FIELD_REGION_RULE_PAYMENT_LABEL="Payment Region Rule"
COM_PHOCACART_FIELD_REGION_RULE_PAYMENT_DESC="Set which region (based on billing or shipping address) should be applied for payment region rule."
COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_PRICE_LABEL_LABEL="Printed Catalog - Display Price Labels"
COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_PRICE_LABEL_DESC="Display or hide price labels in printed catalog"
COM_PHOCACART_FIELD_ENABLE_CREATING_PRINTED_CATALOG_LABEL="Enable Creating of Printed Catalog"
COM_PHOCACART_FIELD_ENABLE_CREATING_PRINTED_CATALOG_DESC="Enable or disable creating of printed catalog. Please note that the number of products that can be displayed in printed catalog (PDF document) is limited by the performance and capabilities of the server. This method of creating a catalog is intended only for small number of products, usually performed sequentially for each category."
COM_PHOCACART_ERROR_CREATING_PRINTED_CATALOG_DISABLED="Error - creating of printed catalog is disabled."
COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_CATEGORY_TITLE_LABEL="Printed Catalog - Display Category Title"
COM_PHOCACART_FIELD_PRINTED_CATALOG_DISPLAY_CATEGORY_TITLE_DESC="Display or hide category title in printed catalog."
COM_PHOCACART_FIELD_PRINTED_CATALOG_CSS_LABEL="Printed Catalog CSS"
COM_PHOCACART_FIELD_PRINTED_CATALOG_CSS_DESC="Set CSS for printed catalog. Note that not all CSS attributes can be displayed in PDF document."
COM_PHOCACART_PRINTED_CATALOG_OPTIONS_LABEL="Printed Catalog Options"
COM_PHOCACART_FIELD_PRINTED_CATALOG_HEADER_LABEL="Printed Catalog Header"
COM_PHOCACART_FIELD_PRINTED_CATALOG_HEADER_DESC="Set printed catalog header. Note that not all HTML tags and attributes can be displayed in PDF document."
COM_PHOCACART_FIELD_PRINTED_CATALOG_DOCUMENT_TITLE_LABEL="Printed Catalog Document Title"
COM_PHOCACART_FIELD_PRINTED_CATALOG_DOCUMENT_TITLE_DESC="Set document title of printed catalog"
COM_PHOCACART_CATALOG="Catalog"
COM_PHOCACART_WARNING_CATALOG_MAKE_SELECTION="Please make a selection from the list to create catalog"
COM_PHOCACART_CREATE_CATALOG_HTML="Catalog (HTML)"
COM_PHOCACART_CREATE_CATALOG_PDF="Catalog (PDF)"
COM_PHOCACART_FIELD_IMAGE_CATEGORIES_VIEW_LABEL="Image (Categories View)"
COM_PHOCACART_FIELD_IMAGE_CATEGORIES_VIEW_DESC="Set image representing categories view. Such an image is used, for example, by open graph plugins."
COM_PHOCACART_FIELD_IMAGE_ITEMS_VIEW_LABEL="Image (Items View)"
COM_PHOCACART_FIELD_IMAGE_ITEMS_VIEW_DESC="Set image representing items view. Such an image is used, for example, by open graph plugins."
;[3.5.1]
COM_PHOCACART_ERROR_USER_EMAIL_NOT_EXISTS="Error - user's email does not exist"
COM_PHOCACART_FIELD_EXPORT_PARAMETERS_LABEL="Export Parameters"
Expand Down
218 changes: 218 additions & 0 deletions admin/layouts/catalog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$d = $displayData;
$price = new PhocacartPrice();
$taxes = PhocacartTax::getAllTaxesIncludingCountryRegion();
$pathItem = PhocacartPath::getPath('productimage');



$p = array();
$p['printed_catalog_enable'] = $d['params']->get( 'printed_catalog_enable', 0);
$p['printed_catalog_header'] = $d['params']->get( 'printed_catalog_header', '');
$p['printed_catalog_document_title'] = $d['params']->get( 'printed_catalog_document_title', '');
$p['printed_catalog_css'] = $d['params']->get( 'printed_catalog_css', '');
$p['printed_catalog_display_category_title'] = $d['params']->get( 'printed_catalog_display_category_title', 1);
$p['printed_catalog_display_price_label'] = $d['params']->get( 'printed_catalog_display_price_label', 0);


if ($p['printed_catalog_enable'] == 0) {
echo JText::_('COM_PHOCACART_ERROR_CREATING_PRINTED_CATALOG_DISABLED');
exit;
}


$document = JFactory::getDocument();
$document->setTitle(JText::_($p['printed_catalog_document_title']));


$s = '<style>';
/*echo '.ph-catalog-doc {line-height:0.8;}
.ph-catalog-header {line-height:0.5;}
.ph-catalog-img {height: auto;width: auto;}
.ph-catalog-col1 {width: 10%;padding-right:3px;}
.ph-catalog-col2 {width: 90%;padding-left:3px;}
.ph-catalog-price {text-align: right;font-weight: bold;}
.ph-catalog-sep {border-bottom: 1px solid #f0f0f0;}
.ph-catalog-sep-margin {font-size: 8px;}
.ph-catalog-ean {line-height:0.1;}
.ph-catalog-table, .ph-catalog-table-in {width: 100%;}
.ph-catalog-title {font-weight:bold;font-size:160%;color:blue;line-height:0.8;}
.ph-catalog-desc-long {font-size: 85%;line-height:1;}
.ph-catalog-price {line-height: 1;font-size: 90%;text-align:right;}
.ph-catalog-price-table {width: 200pt;}
.ph-catalog-price-item {text-align:right; font-weight: bold;}
.ph-catalog-price-item-txt {text-align:left;}';*/
$s .= trim(strip_tags($p['printed_catalog_css']));
$s .= '</style>';

if ($d['format'] == 'pdf'){
echo $s;
} else if ($d['format'] == 'html'){
$document->addCustomTag($s);
} else if ($d['format'] == 'raw') {
echo '<html><head><title>'.JText::_('COM_PHOCACART_CATALOG').'</title>'.$s.'</head><body>';
}




echo '<div class="ph-catalog-doc">';// start doc

// HEADER
$header = PhocacartRenderFront::renderArticle($p['printed_catalog_header'], $d['format']);
if ($header != '') {
echo '<div class="ph-catalog-header">';
echo $header;
echo '</div>';
}

echo '<table class="ph-catalog-table" cellspacing="0" cellpadding="0" >';


// ITEMS
$previousCatid = 0;
foreach($d['items'] as $k => $v) {


// Category Title
if ($p['printed_catalog_display_category_title'] == 1 && $v['category_title'] != '' && $v['category_id'] != $previousCatid) {
echo '<tr nobr="true"><td style="width:100%">';
echo '<div class="ph-catalog-category-header">'.$v['category_title']. '</div>';
$previousCatid = $v['category_id'];
echo '</td></tr>';
}


echo '<tr nobr="true"><td style="width:100%">';


echo '<table class="ph-catalog-table-in" cellspacing="0" cellpadding="1">';


echo '<tr>';

// 1) COLUMN - Image
echo '<td class="ph-catalog-col1">';
if ($v['image'] != '') {

$image = PhocacartImage::getThumbnailName($pathItem, $v['image'], 'small');
echo '<img class="ph-catalog-img" src="'. JURI::root(true) . '/' . $image->rel.'" alt="'.PhocacartText::filterValue($v['title'], 'text').'" />';
}
echo '</td>';

// 2) COLUMN - Text
echo '<td class="ph-catalog-col2">';
echo '<div class="ph-catalog-title">'. $v['title'].'</div>';

if ($v['description_long'] != '') {
echo '<div class="ph-catalog-desc-long">'. $v['description_long'].'</div>';
} else if ($v['description']) {
echo '<div class="ph-catalog-desc">'. $v['description'].'</div>';
} else if ($v['features']) {
echo '<div class="ph-catalog-features">'. $v['features'].'</div>';
}


echo '<table><tr><td>';

// 2)1) SUBCLUMN SKU EAN
// SKU
if ($v['sku'] != '') {

echo '<div class="ph-catalog-sku">'.$v['sku'].'</div>';

}

// EAN
if ($v['ean'] != '') {

if ($d['format'] == 'pdf') {
echo '<div class="ph-catalog-ean">{phocapdfeancode|'.urlencode((int)$v['ean']).'}</div>';
} else {
echo '<div class="ph-catalog-ean">'.(int)$v['ean'].'</div>';
}

}

echo '</td>';

echo '<td>';

// 2)2) SUBCOLUMN PRICE
$priceItems = $price->getPriceItems($v['price'], $v['taxid'], $v['taxrate'], $v['taxcalculationtype'], $v['taxtitle'], $v['unit_amount'], $v['unit_unit'], 1, 1, NULL);


//echo '<div class="ph-catalog-price">'. $price->getPriceFormat($v['price']).'</div>';

echo '<div class="ph-catalog-price"><br />';

if (!empty($priceItems)) {

if ($p['printed_catalog_display_price_label'] == 1) {
$priceItems['nettotxt'] .= ': ';
$priceItems['taxtxt'] .= ': ';
$priceItems['bruttotxt'] .= ': ';
} else {
$priceItems['nettotxt'] = '';
$priceItems['taxtxt'] = '';
$priceItems['bruttotxt'] = '';
}


echo '<table class="ph-catalog-price-table">';

if ($priceItems['netto'] != 0 && $priceItems['netto'] != $priceItems['brutto']) {
echo '<tr><td class="ph-catalog-price-item-txt">' . $priceItems['nettotxt'] . ' </td><td class="ph-catalog-price-item">' . $priceItems['nettoformat'] . '</td></tr>';
} else {
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
}
if ($priceItems['tax'] != 0 && $priceItems['netto'] != $priceItems['brutto']) {
echo '<tr><td class="ph-catalog-price-item-txt">' . $priceItems['taxtxt'] . ' </td><td class="ph-catalog-price-item">' . $priceItems['taxformat'] . '</td></tr>';
} else {
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
}
if ($priceItems['brutto'] != 0) {
echo '<tr><td class="ph-catalog-price-item-txt">' . $priceItems['bruttotxt'] . ' </td><td class="ph-catalog-price-item">' . $priceItems['bruttoformat'] . '</td></tr>';
} else {
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
}

echo '</table>';
}

echo '</div>';

echo '</td></tr></table>';


echo '</td>';

echo '</tr>';
echo '</table>';


echo '<div class="ph-catalog-sep"></div>';
echo '<div class="ph-catalog-sep-margin">&nbsp;</div>';
echo '</td></tr>';

}


echo '</table>';

echo '</div>';// end doc

echo '<p>&nbsp;</p>';


if ($d['format'] == 'raw') {
echo '</body></html>';
}
Loading

0 comments on commit ee621d0

Please sign in to comment.