Forums

Covering OroCommerce, OroCRM, OroPlatform topics, including community updates and company announcements.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • in reply to: Symfony Form constraints not working for my Custom Form type #40715

    Shahriar
    Participant

    The Validation works from the Backend, but I want the Frontend Validation as well.

    Attachments:
    1. Screen-Shot-2019-10-16-at-3.31.44-PM-128x72
    in reply to: Symfony Form constraints not working for my Custom Form type #40711

    Shahriar
    Participant

    But that is already defined in the Parent form type
    vendor/oro/commerce/src/Oro/Bundle/ProductBundle/Form/Type/FrontendLineItemType.php class

    Also the other children Form types like vendor/oro/commerce/src/Oro/Bundle/ProductBundle/Form/Type/QuantityType.php does not have the validation group defined separately.

    Also, more info, my validation works for the Backend which is loaded from the validation.yml. It just does not work on FrontEnd. The input element does not show a ‘data-validation’ attribute for my custom form just like it does for the QuantityType form.

    What am I missing here?

    Thanks in advance.

    • This reply was modified 2 years, 1 month ago by  Shahriar.
    • This reply was modified 2 years, 1 month ago by  Shahriar.
    in reply to: Want to override ProductBundle's validation.yml #40683

    Shahriar
    Participant

    Just to clarify, the First screenshot is how validation.yml is set in Oro’s ProductBundle.

    The Trial screenshots are how I tried to overwrite from my own custom bundle’s validation.yml.

    • This reply was modified 2 years, 1 month ago by  Shahriar.
    in reply to: How does 'Direct URLs' section of Admin panel works? #40424

    Shahriar
    Participant

    Thanks. After running message consumer the product prefixes are working. But they are only working on accessing products from Master Catalog.

    I also have a web catalog on, whenever I am accessing those same products from Web Catalog, the prefixes dont show up. Do you have any idea on why that might be?

    Thanks. :)


    Shahriar
    Participant

    Okay, I fixed it. Thanks for the suggestion!
    You are right, I dont need to extend ProductBundle’s Configuration instead I can just have my own bundle’s Configuration.

    It looks like, I was adding Configuration for my own bundle but was not really calling it correct ALIAS.

    I corrected this function in my NewBrandsProvider class

    Also corrected the service name in system_configuration_services.yml

    My getSegmentId() is now returning the id. This is resolved now. :)

    • This reply was modified 2 years, 4 months ago by  Shahriar.

    Shahriar
    Participant

    Then actual error looks like this:

    new_brands_segment_id is not found in oro_product.settings


    Shahriar
    Participant

    Hello Andrey,
    Thanks for your reply. Let me give you more info on what am I trying to achieve here.

    I created a custom segment called New Brands, which I want to show on my Home page similar to Featured Product or New Arrivals. My New Brand Segment uses a condition to show brands that are created between certain dates. Right now, I have created a NewBrandsProvider, where I used a segmentManager to fetch New Brands segment by id. This works when I pass in segment id with hard code. But I am trying to get the id dynamically as well. This is how my NewBrandsProvider looks:

    I also added a system_configuration_services.yml with below:

    Now if I add the below NEW_BRANDS_SEGMENT_ID node inside OroProductBundle Configuration.php, my NewBrandsProvider can dynamically get the segment id with getSegmentId() function. Which tells me I can manually add a configuration node for my custom Segment ID which I can make query on.

    But obviously, I don’t want to edit core codes and want the same facility by using same logic in my custom bundle.

    Which is why I wanted to make my own Configuration.php but it was returning “null” for getSegmentId().

    Alternate Ways I tried: I thought I need to extend ProductBundle’s Configuration.php as Brand entity is defined inside ProductBundle. So, after my custom bundle’s(BrandBundle) Configuration.php was not working, I also added the below Extension class to extend ProductBundle’s configs from my Custom Bundle.

    But after adding this extension, I was getting error on cache:clear saying NEW_BRANDS_SEGMENT_ID was not found.

    I am sorry for this long post but will appreciate any advice to the right direction. :)

    • This reply was modified 2 years, 4 months ago by  Shahriar.
    • This reply was modified 2 years, 4 months ago by  Shahriar.
Viewing 7 replies - 1 through 7 (of 7 total)

You will be redirected to [title]. Would you like to continue?

Yes No