-
Notifications
You must be signed in to change notification settings - Fork 60
EPS-1517: Woo product widget development #1316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a203053
Adding Woo Products widget
ShubhamGupta05 acea3ec
updated code for Woo Product widget
ShubhamGupta05 72fa5e6
Removed extra check code that is not required
ShubhamGupta05 6f2ecb1
Imporve code base and updated since with default tag
ShubhamGupta05 fd1454d
Updated widget title
ShubhamGupta05 3ca591c
added change log
ShubhamGupta05 ed82967
Merge branch 'release-candidate' into Woo-product-development
ShubhamGupta05 50b175d
Change labels
ShubhamGupta05 bdd2406
Removed source control and make it work for for all products
ShubhamGupta05 5fae341
Updated Image hover to size setting
ShubhamGupta05 5ff14e3
Added few settings
ShubhamGupta05 4daaa48
Updated few settings
ShubhamGupta05 37f660b
Added new settings
ShubhamGupta05 b753c26
Added new settings and updated the default value and css changes
ShubhamGupta05 66aa198
Fixed styling controls
ShubhamGupta05 f0a1605
Fixed base name of the widget to Woo Product Grid
ShubhamGupta05 5a61e0d
Merge branch 'release-candidate' into Woo-product-development
ShubhamGupta05 542c2ff
Added static Promotion
ShubhamGupta05 f513a1d
changed conditon
ShubhamGupta05 ad3f5ba
Added widget in widget usage tracking
ShubhamGupta05 fa157a4
Fixed price color setting and rating div
ShubhamGupta05 224d6bb
Fixed changes
ShubhamGupta05 4d3d294
Merge branch 'release-candidate' into Woo-product-development
ShubhamGupta05 9148dab
Updated default state for settings
ShubhamGupta05 83532b7
Removed order setting when orderby is set to random
ShubhamGupta05 eaecb39
Added utm parameter
ShubhamGupta05 24b98ff
Fetch title using woocommerce function
ShubhamGupta05 3deb298
Merge branch 'release-candidate' into Woo-product-development
ShubhamGupta05 2a87725
Added min height for review rating
ShubhamGupta05 7f8082d
Updated string
ShubhamGupta05 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * HFE Woo Products Widget JavaScript | ||
| */ | ||
| (function($) { | ||
| 'use strict'; | ||
|
|
||
| var HFEWooProducts = { | ||
| init: function() { | ||
| this.bindEvents(); | ||
| }, | ||
|
|
||
| bindEvents: function() { | ||
| // Add any interactive functionality here | ||
| $(document).on('click', '.hfe-product-add-to-cart .button', this.handleAddToCart); | ||
| }, | ||
|
|
||
| handleAddToCart: function(e) { | ||
| var $button = $(this); | ||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Add loading state | ||
| $button.addClass('loading'); | ||
|
|
||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Remove loading state after WooCommerce handles the request | ||
| setTimeout(function() { | ||
| $button.removeClass('loading'); | ||
| }, 2000); | ||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| }; | ||
|
|
||
| // Initialize when document is ready | ||
| $(document).ready(function() { | ||
| HFEWooProducts.init(); | ||
| }); | ||
|
|
||
| // Initialize for Elementor editor | ||
| $(window).on('elementor/frontend/init', function() { | ||
| elementorFrontend.hooks.addAction('frontend/element_ready/hfe-woo-product-grid.default', function($scope) { | ||
| HFEWooProducts.init(); | ||
| }); | ||
| }); | ||
|
|
||
| })(jQuery); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2171,4 +2171,4 @@ body .elementor .hfe-button-wrapper a { | |
| } | ||
| .hfe-post-title { | ||
| font-size: 20px; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,290 @@ | ||
| /* HFE Woo Products Widget Styles */ | ||
| .hfe-woo-products-wrapper { | ||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| width: 100%; | ||
| } | ||
|
|
||
| .hfe-woo-products-grid { | ||
| display: grid; | ||
| grid-template-columns: repeat(4, 1fr); | ||
| gap: 35px 20px; | ||
| } | ||
|
|
||
| .hfe-product-item { | ||
| background: #ffffff; | ||
| border-radius: 8px; | ||
| overflow: hidden; | ||
| border: 1px solid #f0f0f0; | ||
| } | ||
|
|
||
|
|
||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .hfe-product-image { | ||
| position: relative; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .hfe-product-image img { | ||
| width: 100%; | ||
| height: auto; | ||
| display: block; | ||
| } | ||
|
|
||
|
|
||
| .hfe-product-content { | ||
| padding: 20px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .hfe-product-category { | ||
| font-size: 12px; | ||
| text-transform: uppercase; | ||
| letter-spacing: 0.8px; | ||
| margin-bottom: 8px; | ||
| opacity: 0.75; | ||
| font-weight: 500; | ||
| color: #666; | ||
| } | ||
|
|
||
| .hfe-product-title { | ||
| margin: 0 0 12px 0; | ||
| font-size: 16px; | ||
| line-height: 1.5; | ||
| font-weight: 600; | ||
| flex-grow: 1; | ||
| } | ||
|
|
||
| .hfe-product-title a { | ||
| color: #333; | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .hfe-product-title h2 { | ||
| margin: 0; | ||
| font-size: inherit; | ||
| line-height: inherit; | ||
| font-weight: inherit; | ||
| color: inherit; | ||
| } | ||
|
|
||
| .hfe-product-title .hfe-loop-product__link { | ||
| display: block; | ||
| } | ||
|
|
||
|
|
||
| .hfe-product-rating { | ||
| margin-bottom: 12px; | ||
| } | ||
|
|
||
| .hfe-product-rating .review-rating { | ||
| display: flex; | ||
| align-items: center; | ||
| min-height: 16px; | ||
| } | ||
|
|
||
| .hfe-product-rating .star-rating { | ||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| font-size: 14px; | ||
| color: #ffa500; | ||
| display: inline-block; | ||
| } | ||
|
|
||
| .hfe-product-price { | ||
| margin-bottom: 16px; | ||
| font-weight: 700; | ||
| font-size: 18px; | ||
| } | ||
|
|
||
| .hfe-product-price .price { | ||
| color: #333; | ||
| } | ||
|
|
||
| .hfe-product-price .price del { | ||
| opacity: 0.6; | ||
| margin-right: 8px; | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| .hfe-product-description { | ||
| margin-bottom: 16px; | ||
| font-size: 14px; | ||
| line-height: 1.6; | ||
| color: #666; | ||
| flex-grow: 1; | ||
| } | ||
|
|
||
| .hfe-product-add-to-cart { | ||
| margin-top: auto; | ||
| } | ||
|
|
||
| .hfe-woo-products-wrapper .hfe-product-add-to-cart .button { | ||
| width: auto; | ||
| min-width: 100px; | ||
| padding: 12px 20px; | ||
| border: none; | ||
| border-radius: 4px; | ||
| background: #007cba; | ||
| color: #ffffff; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| text-transform: uppercase; | ||
| letter-spacing: 0.5px; | ||
| cursor: pointer; | ||
| text-decoration: none; | ||
| display: inline-block; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hfe-woo-products-wrapper .hfe-product-add-to-cart .button:hover, | ||
| .hfe-woo-products-wrapper .hfe-product-add-to-cart .button:focus, | ||
| .hfe-woo-products-wrapper .hfe-product-add-to-cart .button:active, | ||
| .hfe-woo-products-wrapper .hfe-product-add-to-cart a.button:link { | ||
| text-decoration: none; | ||
| } | ||
|
|
||
|
|
||
| .hfe-woo-products-notice, | ||
| .hfe-woo-products-empty { | ||
| text-align: center; | ||
| padding: 40px 20px; | ||
| background: #f8f9fa; | ||
| border-radius: 4px; | ||
| color: #666; | ||
| } | ||
|
|
||
| /* Card Hover Effects */ | ||
| .hfe-product-item { | ||
| height: 100%; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .hfe-product-content { | ||
| flex: 1; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| /* Content Alignment Classes */ | ||
| .hfe-content-align-left .hfe-product-item { | ||
| text-align: left; | ||
| } | ||
|
|
||
| .hfe-content-align-left .hfe-product-item .star-rating { | ||
| margin-left: 0; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .hfe-content-align-center .hfe-product-item { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hfe-content-align-center .hfe-product-item .star-rating { | ||
| margin-left: auto; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .hfe-content-align-right .hfe-product-item { | ||
| text-align: right; | ||
| } | ||
|
|
||
| .hfe-content-align-right .hfe-product-item .star-rating { | ||
| margin-left: auto; | ||
| margin-right: 0; | ||
| } | ||
|
|
||
| /* Tablet Responsive Alignment */ | ||
| @media (max-width: 1024px) { | ||
| .hfe-content-tablet-align-left .hfe-product-item { | ||
| text-align: left; | ||
| } | ||
|
|
||
| .hfe-content-tablet-align-left .hfe-product-item .star-rating { | ||
| margin-left: 0; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .hfe-content-tablet-align-center .hfe-product-item { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hfe-content-tablet-align-center .hfe-product-item .star-rating { | ||
| margin-left: auto; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .hfe-content-tablet-align-right .hfe-product-item { | ||
| text-align: right; | ||
| } | ||
|
|
||
| .hfe-content-tablet-align-right .hfe-product-item .star-rating { | ||
| margin-left: auto; | ||
| margin-right: 0; | ||
| } | ||
| } | ||
|
|
||
| /* Mobile Responsive Alignment */ | ||
| @media (max-width: 767px) { | ||
| .hfe-content-mobile-align-left .hfe-product-item { | ||
| text-align: left; | ||
| } | ||
|
|
||
| .hfe-content-mobile-align-left .hfe-product-item .star-rating { | ||
| margin-left: 0; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .hfe-content-mobile-align-center .hfe-product-item { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hfe-content-mobile-align-center .hfe-product-item .star-rating { | ||
| margin-left: auto; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| .hfe-content-mobile-align-right .hfe-product-item { | ||
| text-align: right; | ||
| } | ||
|
|
||
| .hfe-content-mobile-align-right .hfe-product-item .star-rating { | ||
| margin-left: auto; | ||
| margin-right: 0; | ||
| } | ||
| } | ||
|
|
||
| /* Responsive Design */ | ||
| @media (max-width: 1200px) { | ||
| .hfe-woo-products-grid { | ||
| grid-template-columns: repeat(3, 1fr); | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .hfe-woo-products-grid { | ||
| grid-template-columns: repeat(2, 1fr); | ||
| gap: 20px 15px; | ||
| } | ||
|
|
||
| .hfe-product-content { | ||
| padding: 16px; | ||
| } | ||
|
|
||
| .hfe-product-title { | ||
| font-size: 15px; | ||
| } | ||
|
|
||
| .hfe-product-price { | ||
| font-size: 16px; | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 480px) { | ||
| .hfe-woo-products-grid { | ||
| grid-template-columns: 1fr; | ||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| gap: 25px; | ||
| } | ||
|
|
||
| .hfe-product-content { | ||
| padding: 18px; | ||
| } | ||
| } | ||
ShubhamGupta05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.