Skip to content

Commit

Permalink
Preparation 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shopizer-ecommerce committed Sep 5, 2022
1 parent f88bc58 commit 48f4e5a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void saveProductImageMethod() {
@Pointcut("serviceMethods() && saveProductImageMethod()")
public void entityProductImageCreationMethods() {
}

@AfterReturning(value = "entityProductImageCreationMethods()", returning = "entity")
public void createProductImageEvent(JoinPoint jp, Object entity) throws Throwable {
eventPublisher.publishEvent(new SaveProductImageEvent(eventPublisher, (ProductImage)entity, ((ProductImage)entity).getProduct()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,27 +792,29 @@ public ProductList listByStore(MerchantStore store, Language language, ProductCr
/**
* variants
*/
qs.append(" left join fetch p.instances pinst ");
qs.append(" left join fetch pinst.variant pv ");
qs.append( "left join fetch pv.productOption pvpo ");
qs.append(" left join fetch pv.productOptionValue pvpov ");
qs.append(" left join fetch pvpo.descriptions pvpod ");
qs.append(" left join fetch pvpov.descriptions pvpovd ");

qs.append(" left join fetch pinst.variantValue pvv ");
qs.append(" left join fetch pvv.productOption pvvpo ");
qs.append(" left join fetch pvv.productOptionValue pvvpov ");
qs.append(" left join fetch pvvpo.descriptions povvpod ");
qs.append(" left join fetch pvpov.descriptions povvpovd ");

//instance availability and price
qs.append(" left join fetch pinst.availabilities pinsta ");
qs.append(" left join fetch pinsta.prices pinstap ");
qs.append(" left join fetch pinstap.descriptions pinstapdesc ");
qs.append(" left join fetch pinst.productInstanceGroup pinstg ");
qs.append(" left join fetch pinstg.images pinstgimg ");
qs.append(" left join fetch pinstgimg.descriptions ");
if(criteria.getOrigin().equals(ProductCriteria.ORIGIN_SHOP)) {
qs.append(" left join fetch p.instances pinst ");
qs.append(" left join fetch pinst.variant pv ");
qs.append( "left join fetch pv.productOption pvpo ");
qs.append(" left join fetch pv.productOptionValue pvpov ");
qs.append(" left join fetch pvpo.descriptions pvpod ");
qs.append(" left join fetch pvpov.descriptions pvpovd ");

qs.append(" left join fetch pinst.variantValue pvv ");
qs.append(" left join fetch pvv.productOption pvvpo ");
qs.append(" left join fetch pvv.productOptionValue pvvpov ");
qs.append(" left join fetch pvvpo.descriptions povvpod ");
qs.append(" left join fetch pvpov.descriptions povvpovd ");

//instance availability and price
qs.append(" left join fetch pinst.availabilities pinsta ");
qs.append(" left join fetch pinsta.prices pinstap ");
qs.append(" left join fetch pinstap.descriptions pinstapdesc ");
qs.append(" left join fetch pinst.productInstanceGroup pinstg ");
qs.append(" left join fetch pinstg.images pinstgimg ");
qs.append(" left join fetch pinstgimg.descriptions ");
//end variants
}

/** not required at list level **/
//qs.append(" left join fetch p.relationships pr");
Expand Down
Binary file modified sm-shop/files/store/StoreRepository.dat
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public ReadableProductList list(
**/

searchCriterias.setMaxCount(count);
searchCriterias.setOrigin(ProductCriteria.ORIGIN_SHOP);
searchCriterias.setLanguage(language.getCode());

try {
return productFacadeV2.getProductListsByCriterias(merchantStore, language, searchCriterias);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,23 @@ public List<SearchItem> search(MerchantStore store, Language language, SearchPro

private SearchResponse search(MerchantStore store, String languageCode, String query, Integer count,
Integer start) {

Validate.notNull(query,"Search Keyword must not be null");
Validate.notNull(languageCode, "Language cannot be null");
Validate.notNull(store,"MerchantStore cannot be null");


try {
LOGGER.debug("Search " + query);
SearchRequest searchRequest = new SearchRequest();
searchRequest.setLanguage(languageCode);
searchRequest.setSearchString(query);
searchRequest.setStore(store.getCode());


//aggregations

//TODO add scroll
return searchService.search(store, languageCode, searchRequest, count, start);

} catch (ServiceException e) {
Expand Down Expand Up @@ -169,7 +180,7 @@ public ValueList autocompleteRequest(String word, MerchantStore store, Language

SearchRequest req = new SearchRequest();
req.setLanguage(language.getCode());
req.setStore(store.getCode());
req.setStore(store.getCode().toLowerCase());
req.setSearchString(word);
req.setLanguage(language.getCode());

Expand Down

0 comments on commit 48f4e5a

Please sign in to comment.