Skip to content

Commit 3041fac

Browse files
author
jefffischer
committed
Merge pull request BroadleafCommerce#1430 from BroadleafCommerce/qa-660-retailprice
issue 660 - exposing prices as price from default SKU
2 parents 0d33b47 + b5f116a commit 3041fac

File tree

2 files changed

+181
-146
lines changed

2 files changed

+181
-146
lines changed

core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/catalog/domain/Product.java

+27-12
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
* limitations under the License.
1818
* #L%
1919
*/
20+
2021
package org.broadleafcommerce.core.catalog.domain;
2122

2223
import org.broadleafcommerce.common.copy.MultiTenantCloneable;
2324
import org.broadleafcommerce.common.media.domain.Media;
25+
import org.broadleafcommerce.common.money.Money;
2426
import org.broadleafcommerce.common.vendor.service.type.ContainerShapeType;
2527
import org.broadleafcommerce.common.vendor.service.type.ContainerSizeType;
2628

@@ -183,7 +185,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
183185
* @return a boolean indicates if the product is active.
184186
*/
185187
public boolean isActive();
186-
188+
187189
/**
188190
* Gets the default {@link Sku} associated with this Product. A Product is
189191
* required to have a default Sku which holds specific information about the Product
@@ -210,7 +212,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
210212
* @param defaultSku - the Sku that should be the default for this Product
211213
*/
212214
public void setDefaultSku(Sku defaultSku);
213-
215+
214216
/**
215217
* @return whether or not the default sku can be used for a multi-sku product in the case that no
216218
* product options are set. Defaults to false if not specified. Note that this only affects multi-sku
@@ -273,7 +275,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
273275
* @return all the Skus associated to this Product
274276
*/
275277
public List<Sku> getAllSkus();
276-
278+
277279
/**
278280
* Gets the media for this product. This serves as a pass-through to
279281
* the {@link getDefaultSku()} media
@@ -314,7 +316,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
314316
* @param category
315317
*/
316318
public void setCategory(Category category);
317-
319+
318320
/**
319321
* Returns the default {@link Category} this product is associated with. This method will delegate to
320322
* {@link #getCategory()} by default, unless the "use.legacy.default.category.mode" property is set to
@@ -361,7 +363,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
361363
* @param manufacturer
362364
*/
363365
public void setManufacturer(String manufacturer);
364-
366+
365367
/**
366368
* Returns the {@link Dimension} for this product
367369
* <br />
@@ -456,7 +458,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
456458
* @param depth
457459
*/
458460
public void setDepth(BigDecimal depth);
459-
461+
460462
/**
461463
* Gets the dimension girth
462464
* <br />
@@ -467,7 +469,7 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
467469
* @return the dimension girth
468470
*/
469471
public BigDecimal getGirth();
470-
472+
471473
/**
472474
* Sets the dimension girth
473475
* <br />
@@ -687,12 +689,12 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
687689
* @param overrideGeneratedUrl
688690
*/
689691
public void setOverrideGeneratedUrl(Boolean overrideGeneratedUrl);
690-
692+
691693
/**
692694
* Sets a url-fragment. By default, the system will attempt to create a unique url-fragment for
693695
* this product by taking the {@link Product.getName()} and removing special characters and replacing
694696
* dashes with spaces.
695-
*/
697+
*/
696698
public String getUrlKey();
697699

698700
/**
@@ -716,21 +718,21 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
716718
* @param displayTemplate
717719
*/
718720
public void setDisplayTemplate(String displayTemplate);
719-
721+
720722
/**
721723
* Generates a URL that can be used to access the product.
722724
* Builds the url by combining the url of the default category with the getUrlKey() of this product.
723725
*/
724726
public String getGeneratedUrl();
725-
727+
726728
/**
727729
* Returns a list of the cross sale products for this product as well
728730
* all cross sale products in all parent categories of this product.
729731
*
730732
* @return the cumulative cross sale products
731733
*/
732734
public List<RelatedProduct> getCumulativeCrossSaleProducts();
733-
735+
734736
/**
735737
* Returns a list of the upsale products for this product as well as
736738
* all upsale products in all parent categories of this product.
@@ -783,4 +785,17 @@ public interface Product extends Serializable, MultiTenantCloneable<Product> {
783785
* @param taxCode
784786
*/
785787
public void setTaxCode(String taxCode);
788+
789+
/**
790+
* added just for convenience, references to defaultSku.retailPrice
791+
* @return
792+
*/
793+
public Money getRetailPrice();
794+
795+
/**
796+
* added just for convenience, references defaultSku.retailPrice
797+
* @return
798+
*/
799+
public Money getSalePrice();
800+
786801
}

0 commit comments

Comments
 (0)