Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove,
    Can you please give me some idea about the salePrice. How can we add a new salePrice for an item from Admin. Also in the ProductListItem.html -> How we are geting the sale price
    <span blc:price="*{salePrice}" th:if="*{onSale}" th:classappend="*{onSale}? ' price-new'" ></span>
    Please I just want to understand about the strikeThrough of the retail price to get the sale price.
    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 Any time you see a blc:xyz in the HTML, that is calling a Thymeleaf processor. In this case, it is calling PriceDisplayProcessor. This processor gets the amount as a Money object. Then, the span tag simply has an thymeleaf "if" statement which adds "price-new" or "price-old" css classes depending on if the item is on sale.
    THEBEASTYPUNE
    @THEBEASTYPUNE
    hey all, how can I change default sorting order in admin panel ? Currently I have enabled Order's within admin panel but default sort order is oldest order to newest order and I want to reverse it. Please help me understand it
    Sunny Yu
    @SunnyYu-98

    @THEBEASTYPUNE Hi, you can do that by overriding the AdminOmsOrderController's viewEntityList. Over there you can add a new FilterAndSortCriteria to set which property you want to sort with and how you want to sort it.

    In your case, you can do something like
    FilterAndSortCriteria filterAndSortCriteria = new FilterAndSortCriteria("submitDate"); to sort by the Submit Date of the order, and then filterAndSortCriteria.setSortDirection(SortDirection.DESCENDING); to set the sort direction.
    Then, you just need to add the criteria to the model like this: model.addAttribute("orderAssignmentListGrid", getMyOrdersListGrid(Arrays.asList(filterAndSortCriteria), null, null));. The template will use the model to render the OMS accordingly.

    The FilterAndSortCriteria itself have a lot of properties you can set for filtering and sorting, but the example above should help you reverse the orders sorting

    danielcolgrove
    @danielcolgrove
    @THEBEASTYPUNE One small change to what @SunnyYu-98 stated....you would need to extend AdminOrderController and add the viewEntityList method. AdminOmsOrderController is part of the Enterprise Edition and is not available in the Community Edition.
    THEBEASTYPUNE
    @THEBEASTYPUNE
    @SunnyYu-98 @danielcolgrove Thanks for the input, i will check it
    THEBEASTYPUNE
    @THEBEASTYPUNE
    Hi @SunnyYu-98 @danielcolgrove , when I try to override viewEntityList method, I get following error
    java.lang.IllegalStateException: argument type mismatch
    HandlerMethod details:
    Controller [com.community.admin.order.controller.CustomOrderController]
    Method [public java.lang.String com.community.admin.order.controller.CustomOrderController.viewEntityList(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.springframework.ui.Model,java.util.Map<java.lang.String, java.lang.String>,org.springframework.util.MultiValueMap<java.lang.String, java.lang.String>) throws java.lang.Exception]
    Resolved arguments:
    [0] [type=org.broadleafcommerce.openadmin.web.compatibility.JSCompatibilityRequestWrapper] [value=FirewalledRequest[ SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.savedrequest.SavedRequestAwareWrapper@638cfd3d]]]
    [1] [type=org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterResponse] [value=org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterResponse@607e2b8e]
    [2] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
    [3] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
    [4] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
    Sunny Yu
    @SunnyYu-98
    Hi @THEBEASTYPUNE, it looks like the method you created have a different method signature than the one you're trying to override. I would look at AdminBasicEntityController#viewEntityList's method signature and make sure that all the argument types are correct in the overriding method.
    karthik
    @karthik21091540_twitter

    Hi ALL,

    I am trying to connect the broadleaf commerce demosite with the solr cloud using external Zookeper quorum. I have followed the instructions from below document for zookeeper and solr cloud setup in my local.
    https://www.broadleafcommerce.com/docs/core/6.0/broadleaf-concepts/catalog-and-search/deployment-models/solr-cloud/client-setup.

    I am getting TimeoutException exception while running the broadleaf commerce server. All 3Zookeepers are running on their specified ports..
    Error creating bean with name 'blCatalogSolrConfiguration' defined in class path resource [com/mycompany/core/config/ApplicationSolrConfiguration.class]: Invocation of init method failed; nested exception is org.apache.solr.common.SolrException: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper localhost:2181,localhost:2182,localhost:2183 within 10000 ms

    WARN 166 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

    can anyone let me know how to fix this issue.

    karthik
    @karthik21091540_twitter

    Hi ALL,

    I am trying to connect the broadleaf commerce demosite with the solr cloud using external Zookeper quorum. I have followed the instructions from below document for zookeeper and solr cloud setup in my local.
    https://www.broadleafcommerce.com/docs/core/6.0/broadleaf-concepts/catalog-and-search/deployment-models/solr-cloud/client-setup.

    I am getting TimeoutException exception while running the broadleaf commerce server. All 3Zookeepers are running on their specified ports..
    Error creating bean with name 'blCatalogSolrConfiguration' defined in class path resource [com/mycompany/core/config/ApplicationSolrConfiguration.class]: Invocation of init method failed; nested exception is org.apache.solr.common.SolrException: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper localhost:2181,localhost:2182,localhost:2183 within 10000 ms

    WARN 166 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

    can anyone let me know how to fix this issue.

    Jeff Chung
    @chungchi300
    Hi everyone, The broadleaf works well in my local development environment, but when I deployed to the server, the index page return 404 error but the other page working well https://stackoverflow.com/questions/64633507/broadleaf-commerce-404-on-index-page
    in my production machine, the 8080 and 8443 port is by default empty
    I wonder where can I hire some experts to help me get the website ready and kickstart which I think it should only take 1-2 workday to do it
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @chungchi300
    We can connect and I might help you in resolving the issue. Please inbox me with the details and drop a mail to this mail id: chiranjitsaha1108@gmail.com
    Ritesh Adhikari
    @riteshadhikari17
    Hi @karthik21091540_twitter , I ran into a situation where zookeeper was not running even though CLI said it started. Could you verify it is indeed running. Try this ps -ef|grep zookeeper. In the docs where it says to put this in config, "dataDir=/$ZK_HOME/data/1", it wasn't using actual dir. I had to pass in full path.
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove ,
    Can you please let me know the execution of the processors during the submit order. What are the programs or classes getting executed during the submit order and how can I inject my own component into the series of processes.
    Ritesh Adhikari
    @riteshadhikari17
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove
    Can you please let me know in which package should I make the ORM file to fetch details from DB and also please give me an example of what is the mapping I need to do in the Persistance.xml. Whenever I'm trying to make a new orm file under the config folder of core package it is unable to resolve the path.
    I have used the link: https://www.broadleafcommerce.com/docs/core/5.2/broadleaf-concepts/key-aspects-and-configuration/persistence-configuration
    to understand but the orm file path is giving me a problem. Also, there are two steps that I need to do :

    1. Creating the ORM file
    2. Register it in
      <persistence-unit name="blPU" transaction-type="RESOURCE_LOCAL">
       <non-jta-data-source>jdbc/web</non-jta-data-source>
       <mapping-file>path/MyCustomerPhone.orm.xml</mapping-file>...
      </persistence-unit>
      Please let me know that which path I need to choose and why my beans are not getting resolved.

    Kindly reply.

    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove
    Can you please let me know in which package should I make the ORM file to fetch details from DB and also please give me an example of what is the mapping I need to do in the Persistance.xml. Whenever I'm trying to make a new orm file under the config folder of core package it is unable to resolve the path.
    I have used the link: https://www.broadleafcommerce.com/docs/core/5.2/broadleaf-concepts/key-aspects-and-configuration/persistence-configuration
    to understand but the orm file path is giving me a problem. Also, there are two steps that I need to do :
    Creating the ORM file
    Register it in

    <persistence-unit name="blPU" transaction-type="RESOURCE_LOCAL">
    <non-jta-data-source>jdbc/web</non-jta-data-source>
    <mapping-file>path/MyCustomerPhone.orm.xml</mapping-file>...
    </persistence-unit>
    Please let me know that which path I need to choose and why my beans are not getting resolved.
    Kindly reply.

    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 Let's take a step back. Are you trying to introduce a new persistence unit outside the default blPU or one of the ones that are out of the box? In most cases you only need to add to the existing blPU. This would be adding your implementation class to core/src/main/resources/META-INF/persistence-core.xml. So something like this:
    <persistence-unit name="blPU" transaction-type="RESOURCE_LOCAL">
        <non-jta-data-source>jdbc/web</non-jta-data-source>
        <class>com.blcdemo.core.domain.PDSiteImpl</class>
        <exclude-unlisted-classes/>
    </persistence-unit>
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove
    I'm using the existing persistence unit. I would like to create my own MyCustomerPhone.orm.xml in the core module and I need to add the mapping file in core/src/main/resources/META-INF/persistence-core.xml. But it is unable to create the bean and it has started throwing me an error during server startup.

    Please let me know the steps for registering a new ORM file and registering it.

    danielcolgrove
    @danielcolgrove
    In the CorePersistenceConfig.java class I see that we have a PersistenceXMLLocations merge setup. I would start there and add your own to that array/list.
    @Merge(targetRef = "blMergedPersistenceXmlLocations", early = true)
    public List<String> corePersistenceXmlLocations() {
        return Arrays.asList("classpath*:/META-INF/persistence-core.xml");
    }
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove
    Got the answer. Thanks a lot for the response. Can you please help me with one more thing? Can you please let me know which SQL query is firing from Broadleaf and I want to print the query into my log Or I can see the list of queries fired for the same call?
    danielcolgrove
    @danielcolgrove

    @chiranjitsaha1108,

    We are using the standard Spring logback mechanism. Having a logback.xml in the classpath is all that is needed. I went ahead and committed a beginning logback.xml file into the Demo project in the develop-6.1.x branch:

    https://github.com/BroadleafCommerce/DemoSite/tree/develop-6.1.x/core/src/main/resources

    You can enable Hibernate logging by adding the following to the logback.xml file:

    <logger name="org.hibernate.SQL" level="DEBUG" />
    <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
    chiranjitsaha1108
    @chiranjitsaha1108
    @danielcolgrove
    LegacyOrderServiceImpl is now Deplocated for BLC 6.0.
    As I have updated the physical fulfilment group and need to update the order with the fulfilment group. Please let me know which implementation class do I need to use and how can I update the order by acquiring a lock on the order object.
    danielcolgrove
    @danielcolgrove

    Hi @chiranjitsaha1108 The LegacyOrderService was deprecated in 2012. See this commit - BroadleafCommerce/BroadleafCommerce@2db5e7a

    The OrderServiceImpl took it's place and that is the service in use out of the box. The implementation can be found here https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.0.x/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/order/service/OrderServiceImpl.java

    There is already an OrderLock in place via the CartStateFilter. See https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.0.x/core/broadleaf-framework-web/src/main/java/org/broadleafcommerce/core/web/order/security/CartStateFilter.java. In addition, there is a transaction in place which is managed in the OrderServiceImpl class.

    The code is available for these classes and you can change the implementation as needed.

    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    I would like to implement a cache in the core part . For which the cache will hold order-related information. This cache will be unique to every order. Can you please let me know the process of creating an order level cache?
    Also registering the cache in the core module.

    danielcolgrove
    @danielcolgrove

    @chiranjitsaha1108 You can register a cache in the bl-override-cache.xml file. See https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/additional-configuration/caching-configuration. You can also see examples of cache entries in the core code - https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.1.x/common/src/main/resources/bl-common-ehcache.xml

    The framework usually handles caching via Hibernate's L2 cache. This is setup on each individual domain class and in the DAOs as query hints. You can find examples in the core code. See

    OrderImpl.java (@Cache annotation)
    https://github.com/BroadleafCommerce/BroadleafCommerce/blob/82a6b4da47a69da51cb9091714c8d7779a26c362/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/order/domain/OrderImpl.java#L105

    OrderDaoImpl (query.SetHint)
    https://github.com/BroadleafCommerce/BroadleafCommerce/blob/82a6b4da47a69da51cb9091714c8d7779a26c362/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/order/dao/OrderDaoImpl.java#L131

    A second approach is manually managing the cache. This approach is less frequent but there are examples. See

    https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.1.x/admin/broadleaf-contentmanagement-module/src/main/java/org/broadleafcommerce/cms/url/service/URLHandlerServiceImpl.java

    So either of the two approaches are valid. The approach depends on what your specific implementation. Note that the links above are the 6.1.x. If you are using a version < 6.1.x you should select that specific documentation set or github branch.

    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove
    First of all thanks a lot for the response.
    I have tried to extend OrderImpl and created my own MyOrderImpl with the same annotation and created a map . But while starting the mvn spring-boot:run it is giving me the below error :
    @javax.persistence.Cacheable or @org.hibernate.annotations.Cache used on a non-root entity:
    Class details :
    @Entity
    @EntityListeners(value = {AuditableListener.class, OrderPersistedEntityListener.class})
    @Inheritance(strategy = InheritanceType.JOINED)
    @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "blOrderElements")
    @AdminPresentationMergeOverrides(
    {
    @AdminPresentationMergeOverride(name = "", mergeEntries =
    @AdminPresentationMergeEntry(propertyType = PropertyType.AdminPresentation.READONLY,
    booleanOverrideValue = true))
    }
    )
    @DirectCopyTransform({
    @DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.PREVIEW, skipOverlaps = true),
    @DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.MULTITENANT_SITE)
    })
    public class MyOrderImpl extends OrderImpl implements MyOrder {
    //cache code :
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "blOrderElements")
    protected Map<String, String> fulfilmentGroupDetails= new HashedMap<String, String>();
    //some code
    }
    Please let me know how can I rectify the error.
    Note : Im using BLC 6.0 and all the changes are being done in the core module.
    Also I have not done any config changes in the core module other than extending the orderImpl.
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    kindly let me know if the above approach has any issue.

    danielcolgrove
    @danielcolgrove
    Broadleaf 6.0 uses Hibernate 5.2.17 which does not support modifying cache configurations on children entities. The root entity cache configuration should be used. You would need to just drop the @Cache annotation in your class. It appears the ability to do this was added in Hibernate 5.3 which we use in Broadleaf 6.1. The first couple links from this search had some additional information - https://www.google.com/search?ei=NJk2YPKCIsPetQWvtY-ACg&q=hibernate+Cache+used+on+a+non-root+entity&oq=hibernate+Cache+used+on+a+non-root+entity&gs_lcp=Cgdnd3Mtd2l6EAMyBAgAEB4yBggAEAgQHjIGCAAQCBAeMgYIABAIEB46BwgAEEcQsAM6BggAEAcQHjoICAAQCBAHEB5Qnx5YoSNgyyRoAXACeACAAWCIAc4EkgEBN5gBAKABAaoBB2d3cy13aXrIAQjAAQE&sclient=gws-wiz&ved=0ahUKEwjy7OjZkYPvAhVDb60KHa_aA6AQ4dUDCA0&uact=5
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    Please tell me one scenario that is there any OOTB functionality is given that I want to hold a transient java collection variable at order level and it is valid as long as the user is Active or logged in.

    Please let me know the procedure that I need to follow to hold a transient variable in order level and it will be active throughout the session.

    danielcolgrove
    @danielcolgrove
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    Can you please provide me an example of useing Quartz or scheduler in Broadleaf commerce. Is it we are storing the details in the DB or in memory (RAM) used to hold the information and execute the scheduler.
    Kindly provide me an example class in BLC through which I can understand more about the architecture followed in BLC.

    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 I don't believe there is an example of using Quartz in BLC commerce edition. Quartz is a 3rd party library that you can introduce into your project and use as you see fit. There is a nice write up on the Baeldung site for implementing using Spring and even guidance for a JDBC backed implementation - https://www.baeldung.com/spring-quartz-schedule
    Parves Ahmed Moon
    @parves-ahmed
    I'm new at broadleaf commerce. I have just downloaded the community version 6.1.5 GA. By following the documentation I'm able to extend AdminAbstractController and able to render test.html page. Now the problem is that I would like to add a module and section like My custom module and custom section in Admin panel as like the documentation say so but I can't and I also can't execute the sql file as I don't know how to execute this sql file here. I know the documentation is for older version. Now Please tell me 1. how can I add a module and section in Admin 2. How the sql file is executed (Thanks in advance)
    danielcolgrove
    @danielcolgrove
    @parves-ahmed One example that you can look at is the Menu module. It has an example of using a sql file for db initialization. The sql file in that module adds admin security and an admin section. https://github.com/BroadleafCommerce/Menu
    Wasif Al Mahmud
    @wasifAL
    Is it possible to get a multi-tenant setup from the community version ? I just need a supervisor-user over the shops.
    Parves Ahmed Moon
    @parves-ahmed
    Thanks, @danielcolgrove I have done that by doing Insert operation directly to DB. But the example of the Menu is well organized.
    danielcolgrove
    @danielcolgrove
    @wasifAL There is not an out of box multi-tenant offering for the Community Edition. We have a Multi-Tenant offer on our Enterprise Edition which requires a license. Alternatively, you can look at customizations to introduce your specific requirements.
    Wasif Al Mahmud
    @wasifAL
    @danielcolgrove thank you for your response. I understand that.
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove
    There is a property in BLC_SKU for QUANTITY_AVAILABLE.
    Is there any OOTB method through which I can decrease the quantity value for a SKU once the order is placed?

    Or do we need to write a custom code in the workflow to decrease the quantity once the order is placed?
    Also is it valid to update the BLC_SKU entity to decrease the value of SKU quantity manually?

    Syed Mainul Hasan
    @mainul35
    I have boot community demo project (DemoSite-broadleaf-5.2.14-GA). I have successfully run it, but now I want to change it from sauces to books. Where can I go to do this change?
    Syed Mainul Hasan
    @mainul35
    Product custom attributes are not showing in heat clinic demo application. What can I do?
    danielcolgrove
    @danielcolgrove
    @mainul35 There is an admin application that you can run that allows you to maintain the products. Regarding custom attributes, where in the heat clinic demo application are they now showing?
    saber872138
    @saber872138
    I see a lot of menus in the official admin sample. For example, "Jobs And Processes", "Scheduled-jobs", "Cart Rules", but there is no initialization script in the code, please tell me how I can configure these menus, or how to get the SQL script.
    danielcolgrove
    @danielcolgrove
    @saber872138 You are running our Community Edition. The admin sample (demo) is running our Enterprise Edition. The Enterprise Edition has a lot of functionality added on top of the Community Edition like Scheduled Jobs, Process Tracking, Cart Rules, to mention the ones you call out.