Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coconva2118
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hanumant Pratap Singh
coconva2118
Commits
edf365ae
Commit
edf365ae
authored
Sep 25, 2019
by
Sujeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating changes of size.
parent
f012f907
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
details.phtml
...op4u/Magento_Catalog/templates/product/view/details.phtml
+46
-0
No files found.
app/design/frontend/Sm/shop4u/Magento_Catalog/templates/product/view/details.phtml
View file @
edf365ae
...
...
@@ -8,6 +8,52 @@
$_config
=
$this
->
helper
(
'Sm\Shop4u\Helper\Data'
);
$tabStyle
=
$_config
->
getProductDetail
(
'tab_style'
);
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$registry
=
$objectManager
->
get
(
'\Magento\Framework\Registry'
);
$currentProduct
=
$registry
->
registry
(
'current_product'
);
$product
=
$objectManager
->
get
(
'Magento\Catalog\Model\Product'
)
->
load
(
$currentProduct
->
getId
());
$length
=
$product
->
getCustomAttribute
(
'ts_dimensions_length'
)
->
getValue
();
$width
=
$product
->
getCustomAttribute
(
'ts_dimensions_width'
)
->
getValue
();
if
(
!
empty
(
$width
)
&&
!
empty
(
$length
))
{
?>
<script>
require
([
'jquery'
,
],
function
(
$
)
{
'use strict'
;
if
(
jQuery
(
'#product_addtocart_form'
).
find
(
'.product-options-wrapper'
).
length
)
{
setTimeout
(
function
(){
var
config
=
{
S
:
10
,
M
:
20
,
L
:
30
,
XL
:
40
,
XXL
:
50
,
XXXL
:
60
,
};
var
baseHeight
=
<?php
echo
$length
;
?>
;
var
baseWidth
=
<?php
echo
$width
;
?>
;
jQuery
(
'#product_addtocart_form #select_2 option'
).
each
(
function
(){
var
$this
=
$
(
this
);
var
value
=
$this
.
text
();
var
percent
=
parseInt
(
config
[
value
]);
console
.
log
(
"------------------------"
,
`==
${
value
}
==`
,
percent
,
config
,
config
[
value
]);
if
(
percent
&&
percent
>
0
)
{
var
heigth
=
parseInt
(
baseHeight
+
(
baseHeight
*
percent
/
100
));
var
width
=
parseInt
(
baseWidth
+
(
baseWidth
*
percent
/
100
));
$this
.
text
(
`
${
value
}
(
${
heigth
}
x
${
width
}
CM)`
);
}
});
},
2000
);
}
});
</script>
<?php
}
$show_custom_tab
=
$_config
->
getProductDetail
(
'show_custom_tab'
);
$custom_tab_name
=
$_config
->
getProductDetail
(
'custom_tab_name'
);
$customtab_content
=
$_config
->
getProductDetail
(
'customtab_content'
);
...
...
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