Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
b1825e83
Commit
b1825e83
authored
May 09, 2023
by
dhn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化购物车属性查询
parent
c1d01700
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
27 deletions
+17
-27
app/design/frontend/Joshine/breeze/Magento_Checkout/templates/cart/item/default.phtml
+17
-27
No files found.
app/design/frontend/Joshine/breeze/Magento_Checkout/templates/cart/item/default.phtml
View file @
b1825e83
...
...
@@ -18,6 +18,21 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$mobileDetect
=
$objectManager
->
get
(
\Joshine\Common\Lib\MobileDetect\MobileDetect
::
class
);
$priceBlock
=
$objectManager
->
get
(
\Magento\Catalog\Block\Product\AbstractProduct
::
class
);
$_options
=
$block
->
getOptionList
();
$resource
=
$objectManager
->
get
(
'Magento\Framework\App\ResourceConnection'
);
$connection
=
$resource
->
getConnection
();
foreach
(
$_options
as
$key
=>
$_option
)
{
if
(
$_option
[
'label'
]
!=
'Size'
)
{
$tableName
=
$resource
->
getTableName
(
'eav_attribute_option_value'
);
$sql
=
"Select value FROM "
.
$tableName
.
" where store_id=0 AND option_id="
.
$_option
[
'option_value'
];
}
else
{
$tableName
=
$resource
->
getTableName
(
'eav_attribute_option_swatch'
);
$sql
=
"Select value FROM "
.
$tableName
.
" where store_id=0 AND option_id="
.
$_option
[
'option_value'
];
}
$result
=
$connection
->
fetchRow
(
$sql
);
$_options
[
$key
][
'value'
]
=
$result
[
'value'
];
}
?>
<div
class=
"cart item is_mobile"
>
...
...
@@ -51,43 +66,18 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct
</p>
<!----------------------------item name end------------------------------------->
<!----------------------------item option start--------------------------------->
<?php
if
(
$_options
=
$block
->
getOptionList
()
)
:?>
<?php
if
(
$_options
)
:?>
<
div
class
="
item
-
options
-
meta
">
<?php
$countOpt
= count(
$_options
);
?>
<?php foreach (
$_options
as
$key
=>
$_option
) :?>
<strong style="
font
-
weight
:
600
;
margin
-
right
:
10
px
;
"><?=
$block->escapeHtml
(
$_option['label']
) ?> :</strong>
<span class="
item
-
options
-
line
">
<?php
$objectManager
= \Magento\Framework\App\ObjectManager::getInstance();
$resource
=
$objectManager->get
('Magento\Framework\App\ResourceConnection');
$connection
=
$resource->getConnection
();
?>
<?php if (
$_option['label']
!= 'Size'){ ?>
<?php
$tableName
=
$resource->getTableName
('eav_attribute_option_value');
$sql
= "
Select
*
FROM
" .
$tableName
."
where
store_id
=
0
AND
option_id
=
".
$_option['option_value']
;
$result
=
$connection->fetchRow
(
$sql
);
?>
<?=
$block->escapeHtml
(
$result['value']
) ?>
<?php }else{
$tableName
=
$resource->getTableName
('eav_attribute_option_swatch');
$sql
= "
Select
*
FROM
" .
$tableName
."
where
store_id
=
0
AND
option_id
=
".
$_option['option_value']
;
$result
=
$connection->fetchRow
(
$sql
);
echo
$result['value']
;
} ?>
<?=
$block->escapeHtml
(
$_option['value']
) ?>
</span><br />
<?php endforeach; ?>
</div>
<?php endif;?>
<div style="
max
-
width
:
100
%
;
width
:
100
%
;
height
:
40
px
;
">
<!----------------------------item handle start--------------------------------->
<div class="
item
-
handle
" style="
width
:
16
%
;
float
:
left
;
position
:
inherit
;
font
-
size
:
16
px
;
">
<div class="
item
-
quantity
">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment