Building a Request for Quote module
Asking a question here, hoping to expand my understanding of XC5 and OOP, and reach out to the community for help. I am developing a "Request for Quote" module for a client.
The idea behind this module is to provide a way fr customers to request a custom quote for any product. The planned functionality is as follows: 1. New attribute RFQ added to the list of attributes, and can be assigned to any product. 2. The attribute functions similar to a textarea. 3. When attribute is assigned to a product, it displays at the below the default attributes on the product page. 4. The textarea is initially hidden, with only a checkbox and the attribute name showing, for example "Request for Quote" could be the display text. 5. When this checkbox is checked the default attributes are hidden, the textarea is revealed, and the previously selected default attribute values are copied into it. 6. Now the customer can continue specifying additional options that they want in the custom quote. 7. When the box is checked the price of the product should change to $0. 8. Once added to cart, the default attributes of the product should not display in the cart or minicart, only the RFQ attribute name, and the value taken from the RFQ textarea. 9. The customer should be able to proceed with checkout with the $0 item in their cart, and customer support personnel can follow up with the quote. I have completed steps 1-6, and still need to complete 7-9. Currently I am attempting to work on #8. I have a function that checks if the current product has an RFQ attribute assigned to it. Here is a portion of my class that does this: Code:
namespace XLite\Module\Baby\RFQ\View\Product\Details\Customer; I have copied a class and a template into my module, creating: Code:
namespace XLite\Module\Baby\RFQ\View; And I have created my template file: default/en/modules/Baby/RFQ/selected_attribute_values/body.tpl With just the same contents as the original so far: Code:
<div class="item-attribute-values"> I am struggling with how to accomplish this. I would like to reuse the function so as not to recreate code. I also need a new function that checks if the attribute has value. Any and all solutions to the problem are welcome and much appreciated. I have sent Tony a copy of my module, anyone that wants a copy just PM me. I can't post it publicly because my client is considering selling it in the marketplace once complete. |
Re: Building a Request for Quote module
The logic sounds too complex to me. Are you sure you need to base the RFQ logic on the Attributes feauture?
As for reusing the code: you can put the code as a public method into either a model class (something like $product->isRFQ(); ), or a new XLite\Module\Baby\RFQ\Core\... class. |
Re: Building a Request for Quote module
Hi Mike!
Sorry, I cannot look into right now, because of upcoming webinar. I will get to it next week and will suggest a solution. Tony. |
Re: Building a Request for Quote module
Hi Mike!
Thanks for your patience! Actually qualiteam is right. You need to make this method isRFQ() be available in the XLite/Model/OrderItem object, so you would be able to use it in the template similar to your default/en/modules/Baby/RFQ/selected_attribute_values/body.tpl or default skins/default/en/selected_attribute_values/body.tpl. Also, you can define your own methods that would display the value of RFQ textarea, so you may need to decorate XLite/Model/OrderItem class and add two more methods - isRFQ() - getRFQValue() Please, let me know if it makes sense and if it is any help for you. Surely, any more questions -- just let me know. Tony. |
Re: Building a Request for Quote module
Mike, did you finish this module? I would be interested in taking a look at it for our site.
|
Re: Building a Request for Quote module
It is finished, and it works great. It should be released very soon. I am not releasing it, I developed it for another company that plans to sell it in the X-cart marketplace.
|
Re: Building a Request for Quote module
Ok, thanks for the quick answer Mike.
|
Re: Building a Request for Quote module
Hey Mike, Hal from NJ here..I think you'll remember me..
Do you know if this Mod was ever offered to the public yet? Thanks.. |
Re: Building a Request for Quote module
Should be soon Hal. But it will be for Xcart 5. Good to hear from you man!
|
Re: Building a Request for Quote module
Hi
i have a customer who would like a website that customers can add items to a basket , then request a quote . there must be no pricing on the website at this point ,(this will be for 6 months to test the market demand ) once they are happy with the demand they want to change to eCommerce , same items just now with pricing . i dont want to redo website from scratch each time +/- 2000 items does xcart have this avaliable sean |
All times are GMT -8. The time now is 02:27 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.