Commit e3707988 by dhn

Merge branch 'developer' of http://47.99.244.21:9999/root/joshine into Branch_developer

parents 82e8a20e f4035c79
......@@ -53,12 +53,13 @@ require(['jquery','banner'],function ($){
h_max = h > h_max ? h : h_max;
});
$('.banner1').height(h_max);
$('.banner1').css('line-height',h_max+'px');
var buttonTop = h_max/2;
$('#left').css({'top':buttonTop,'line-height': 0});
$('#right').css({'top':buttonTop,'line-height': 0});
if (h_max > 0){
$('.banner1').height(h_max);
$('.banner1').css('line-height',h_max+'px');
var buttonTop = h_max/2;
$('#left').css({'top':buttonTop,'line-height': 0});
$('#right').css({'top':buttonTop,'line-height': 0});
}
if (img_arr.length <= 1){
$('.banner1 .list').hide();
$('#left').hide();
......
......@@ -190,7 +190,7 @@ class GoogleFeed extends Command
$name = $category->getName().'-';
$name = $this->getPrdouctType($category,$name);
$name = implode('->',array_reverse(explode('-',rtrim($name,'-'))));
$categoryGoogleProductCategory[$category->getId()]['product type'] = $name;
$categoryGoogleProductCategory[$category->getId()]['product type'] = ltrim($name,'Category->') ;
}
......@@ -256,7 +256,7 @@ class GoogleFeed extends Command
if ($product) {
$data['id'] = $product->getSku();
$data['title'] = $this->getStoreName() .' '. str_replace('"', '\'', $product->getName());
$data['description'] = strip_tags(str_replace('"', '\'', $product->getShortDescription()));
$data['description'] = strip_tags(str_replace('"', '\'', $product->getDescription()));
foreach( $product->getCategoryIds() as $k=>$v){
......
<?php
namespace Joshine\Sales\Plugin;
use \Magento\Catalog\Helper\Image as ImageHelper;
class DefaultRendererPlugin {
/**
* @var \Magento\Catalog\Helper\Image $imageHelper
*/
protected $imageHelper;
/**
* @param ImageHelper $imageHelper
*/
public function __construct
(
ImageHelper $imageHelper
)
{
$this->imageHelper = $imageHelper;
}
public function aroundGetColumnHtml(\Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer $defaultRenderer, \Closure $proceed,\Magento\Framework\DataObject $item, $column, $field=null) {
$result = '';
if($column === 'image') {
if ($item->getProduct()) {
$img = $this->imageHelper->init($item->getProduct(), 'cart_page_product_thumbnail')->setImageFile($item->getProduct()->getImage())->resize(100)->getUrl();
$result = '<img src="'.$img.'" alt="'.$item->getName().'" />';
}
}
else {
if($field) {
$result = $proceed($item,$column,$field);
}
else {
$result = $proceed($item,$column);
}
}
return $result;
}
}
\ No newline at end of file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer">
<plugin name="order-view-image" type="Joshine\Sales\Plugin\DefaultRendererPlugin" sortOrder="1" />
</type>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Joshine_Sales" setup_version="0.0.1"/>
</config>
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Joshine_Sales',
__DIR__
);
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="order_items">
<arguments>
<argument name="columns" xsi:type="array">
<item name="image" xsi:type="string" translate="true">Product Image</item>
<item name="product" xsi:type="string" translate="true">Product</item>
<item name="status" xsi:type="string" translate="true">Item Status</item>
<item name="price-original" xsi:type="string" translate="true">Original Price</item>
<item name="price" xsi:type="string" translate="true">Price</item>
<item name="ordered-qty" xsi:type="string" translate="true">Qty</item>
<item name="subtotal" xsi:type="string" translate="true">Subtotal</item>
<item name="tax-amount" xsi:type="string" translate="true">Tax Amount</item>
<item name="tax-percent" xsi:type="string" translate="true">Tax Percent</item>
<item name="discont" xsi:type="string" translate="true">Discount Amount</item>
<item name="total" xsi:type="string" translate="true">Row Total</item>
</argument>
</arguments>
<referenceBlock name="default_order_items_renderer">
<arguments>
<argument name="columns" xsi:type="array">
<item name="image" xsi:type="string" translate="false">col-image</item>
<item name="product" xsi:type="string" translate="false">col-product</item>
<item name="status" xsi:type="string" translate="false">col-status</item>
<item name="price-original" xsi:type="string" translate="false">col-price-original</item>
<item name="price" xsi:type="string" translate="false">col-price</item>
<item name="qty" xsi:type="string" translate="false">col-ordered-qty</item>
<item name="subtotal" xsi:type="string" translate="false">col-subtotal</item>
<item name="tax-amount" xsi:type="string" translate="false">col-tax-amount</item>
<item name="tax-percent" xsi:type="string" translate="false">col-tax-percent</item>
<item name="discont" xsi:type="string" translate="false">col-discont</item>
<item name="total" xsi:type="string" translate="false">col-total</item>
</argument>
</arguments>
</referenceBlock>
</referenceBlock>
<referenceBlock name='order_totals'>
<action method='setTemplate'>
<argument name='template' xsi:type='string'>Joshine_Sales::order/totals.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
\ No newline at end of file
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/* @var \Magento\Sales\Block\Adminhtml\Order\Totals $block */
?>
<table class="data-table admin__table-secondary order-subtotal-table">
<?php $_totals = $block->getTotals('footer') ?>
<?php if ($_totals) : ?>
<tfoot>
<?php foreach ($block->getTotals('footer') as $_code => $_total) : ?>
<?php if ($_total->getBlockName()) : ?>
<?= $block->getChildHtml($_total->getBlockName(), false) ?>
<?php else : ?>
<tr class="col-<?= $block->escapeHtmlAttr($_code) ?>">
<td <?= /* @noEscape */ $block->getLabelProperties() ?> class="label">
<strong><?= $block->escapeHtml($_total->getLabel()) ?></strong>
</td>
<td <?= /* @noEscape */ $block->getValueProperties() ?>>
<strong><?= /* @noEscape */ $block->formatValue($_total) ?></strong>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tfoot>
<?php endif; ?>
<?php $_totals = $block->getTotals('')?>
<?php if ($_totals) : ?>
<tbody>
<?php foreach ($_totals as $_code => $_total) : ?>
<?php if ($_total->getBlockName()) : ?>
<?= $block->getChildHtml($_total->getBlockName(), false) ?>
<?php else : ?>
<?php $totalsArr[] = $_total->toArray() ?>
<tr class="col-<?= $block->escapeHtmlAttr($_code) ?>">
<td <?= /* @noEscape */ $block->getLabelProperties() ?> class="label">
<?php if ($_total->getStrong()) : ?>
<strong><?= $block->escapeHtml($_total->getLabel()) ?></strong>
<?php else : ?>
<?= $block->escapeHtml($_total->getLabel()) ?>
<?php endif?>
</td>
<?php if ($_total->getStrong()) : ?>
<td <?= /* @noEscape */ $block->getValueProperties() ?>>
<strong><?= /* @noEscape */ $block->formatValue($_total) ?></strong>
</td>
<?php else : ?>
<td <?= /* @noEscape */ $block->getValueProperties() ?>>
<span><?= /* @noEscape */ $block->formatValue($_total) ?></span>
</td>
<?php endif; ?>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php $totalsArr = array_column($totalsArr,null,'code'); ?>
<tr class="col-<?php echo count($totalsArr); ?>">
<td class="label">Row Tatol</td>
<td><span><span class="price">$<?php if (isset($totalsArr['discount'])){echo sprintf("%01.2f",round(floatval($totalsArr['subtotal']['value'])+floatval($totalsArr['discount']['value']),2));}else{echo sprintf("%01.2f",floatval($totalsArr['subtotal']['value']));} ?></span></span> </td>
</tr>
</tbody>
<?php endif; ?>
</table>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment