How can the category and product fields in Shopizer be customized, if possible at all? - shopizer

I am currently using Shopizer as a sort of headless CMS, leveraging its out of the box admin pages and REST API for the content. There is a page for editing products in the admin system but I would like to add and/or remove specific fields. Making changes to the base code seems to be the most obvious solution but it is taking me a significant amount of time to implement it successfully.
Is there some sort of a config file or an initialization process to customize the fields for creating categories and products using Shopizer's admin page? What is the best practice for this scenario if the former approach is not possible?

If you need to add fields the easiest way is to add them in model objects
com.salesmanager.core.model.*
Example of an annotated field
#Column (name ="IP_ADDRESS")
private String ipAddress;
Once you restart your instance the new field will be available.

Related

WordPress : make categories automatically match according to external API Value

I'm managing a company website, where we have to display our products. We however do not want to handle the admin edit for this CPT, nor offer the ability to access to the form. But we have to read some product data form the admin edit page. All has to be created or updated via our CRM platform automatically.
For this matter, I already setup a CPT (wprc_pr) and registered 6 custom hierarchical terms: 1 generic for the types (wprc_pr_type) and 5 targeting each types available: wprc_pr_rb, wprc_pr_sp, wprc_pr_pe, wprc_pr_ce and wprc_pr_pr. All those taxonomies are required for filtering purposes (was the old way of working, maybe not the best, opened to suggestions here). We happen to come out with archive pages links looking like site.tld/generic/specific-parent/specific-child/ which is what is desired here.
I have a internal tool, nodeJS based, to batch create products from our CRM. The job is simple: get all products not yet pushed to the website, format a new post, push it to the WP REST API, wait for response, updated CRM data in consequence, and proceed to next product. Handle about 1600 products today on trialn each gone fine
The issue for now is that in order for me to put the correct terms to the new post, I have to compute for each product the generic type and specific type children.
I handled that by creating 6 files, one for each taxonomy. Each file is basically a giant JS object with the id from the CRM as a key, and the term id as a value. My script handles the category assertion like that:
wp_taxonomy = [jsTaxonomyMapper[crm_id1][crm_id2]] // or [] if not found
I have to say it is working pretty well, and that I could stop here. But I will have to take that computing to the wp_after_insert_post hook, in order to reaffect the post to the desired category on updated if something changed on the CRM.
Not quite difficult, but if I happen to add category on the CRM, I'll have to manually edit my mappers to add the new terms, and believe me that's a hassle.
Not waiting for a full solution here, but a way to work the thing. Maybe a way to computed those mappers and store their values in the options table maybe, or have a mapper class, I don't know at all.
Additional information:
Data from the CRM comes as integers (ids corresponding to a label) and the mappers today consist of 6 arrays (nested or not), about 600 total entries.
If you have something for me, or even suggestions to simplify the process, I'll go with it.
Thanks.
EDIT :
Went with another approach, see comment below.

SuiteCommerce Advanced - Show a custom record on the PDP

I am looking to create a feature whereby a User can download any available documents related to the item from a tab on the PDP.
So far I have created a custom record called Documentation (customrecord_documentation) containing the following fields:
Related item : custrecord_documentation_related_item
Type : custrecord_documentation_type
Document : custrecord_documentation_document
Description : custrecord_documentation_description
Related Item ID : custrecord_documentation_related_item_id
The functionality works fine on the backend of NetSuite where I can assign documents to an Inventory item. The stumbling block is trying to fetch the data to the front end of the SCA webstore.
Any help on the above would be much appreciated.
I've come at this a number of ways.
One way is to create a Suitelet that returns JSON of the document names and urls. The urls can be the real Netsuite urls or they can be the urls of your suitelet where you set up the suitelet to return the doc when accessed with action=doc&id=_docid_ query params.
Add a target <div id="relatedDocs"></div> to the item_details.tpl
In your ItemDetailsView's init_Plugins add
$.getJSON('app/site/hosting/scriptlet.nl...?action=availabledoc').
then(function(data){
var asHtml = format(data); //however you like
$("#relatedDocs").html(asHtml);
});
You can also go the whole module route. If you created a third party module DocsView then you would add DocsView as a child view to ItemDetailsView.
That's a little more involved so try the option above first to see if it fits your needs. The nice thing is you can just about ignore Backbone with this approach. You can make this a little more portable by using a service.ss instead of the suitelet. You can create your own ssp app for the function so you don't have to deal with SCAs url structure.
It's been a while, but you should be able to access the JSON data from within the related Backbone View class. From there, within the return context, output the value you're wanting to the PDP. Hopefully you're extending the original class and not overwriting / altering the core code :P.
The model associated with the PDP should hold all the JSON data you're looking for. Model.get('...') sort of syntax.
I'd recommend against Suitelets for this, as that's extra execution time, and is a bit slower.
I'm sure you know, but you need to set the documents to be available as public as well.
Hope this helps, thanks.

Iframe content not able to save in module params Joomla

I am using Joomla3 with tinymce editor. I have created one module and adding one params in textarea
I am adding iframe code
in text area
but it's not saving. If i am save normal text string then it's saving
Please help me
I believe you need to add a filter to your xml code.
such as:
filter="RAW" or, probably more appropriately, filter="HTML"
This will keep Joomla from cleaning your code. There are a number of filters available to XML fields when creating modules. You can examine the code here: https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/filter/input.php#L167 to see the exact list.
What user group is the account you are using a member of? Super Users and Administrator group types should have no filtering set by default but it sounds like you might need to edit those settings.
From the main menu:
System > Global Configuration > Text Filters (tab)
You will see all the available user groups for you website. The group your user belongs to should have a Filter Type of No Filtering. Another important note is its better to add the user account to a group with the permissions then to arbitrarily adding it to a group type typically reserved for registrants, guests or low-level editing.

Show Opportunity related Contacts in Custom Object Field

I have the next issue.
I have a custom object called 'Application', and I have this requirement:
"Show all Contacts related to an Application. Create a field on Application object, must be read only".
I solve it with apex code. 'Application' has a lookup to Opportunity, Opportunity to Account, and all my contacts have AccountId, so this way, I get all the contacts using apex code in a trigger.
But, I've been ask to change this to a Formula field in Application object.
So, my issue is next. I'm not able to get all contacts with advance formula editor, because they're not part of any object. I have no master-detail relationship.
Does any one know how can I achieve this using configuration? I should not use apex code for this req.
Thank in advance guys.
I don't think you can do it.
In formulas / merge fields syntax there's no way to go "up, up then down" (Application -> Opportunity -> Account -> down to Contacts related list). There's also nothing that would let you loop through Contacts (and display what? Ids? Names? Emails?). Roughly speaking you can only go up through dots.
You might want to explore path of "cross object workflow" rules but I imagine that when I add a new Contact to Account it should somehow "spread itself" to all related Applications? There's no straight way to fire a workflow on delete too - so you'd eventually end up with inaccurate list.
I'd say trigger was a good solution. Maybe it ws unoptimized but if it has to be in a field - tough.
There might be a fairly simple way of achieving that by embedding a visualforce page within Application page layout.
This should be doable with pure Visualforce (so technically there will be no Apex code ;))
Something as simple as
<apex:relatedList list="Contacts" subject="Application__c.Opportunity__r.AccountId" />
would be a good start (if you want your own layout and not a rel. list - you should be still able to pull it off with <apex:repeat> or <apex:pageBlockTable>.
There's one BUT here: it's not a field, just a display trick. Forget about using it in reports, mobile applications etc.
Another way - would it be acceptable to be 1 click away from these contacts? You could make a report "Account with Contacts", filter it by Id of one Account and later use "URL hacking" to change the filter depending on from which Application you'll click it. This link could be either a formula field or a real custom button/link. Technically - it's pure config, no apex & VF.
You can read more about URL hacking at Ray Dehler's excellent post and specifically about dynamic Reports here or here.

Salesforce.com visualforce between 2 objects

In salesforce I need to create a visualforce page that includes the fields of 2 objects. The first object is the QUOTE object. The second objects is a custom object with several fields.
I want to create a visualforce page that shows the records of both QUOTE and the new object. Can I do this without creating a custom controller? If no any hints on the code for this new controller?
Can I do calculations between fields in a visualforce page?
Ideally I want this page to appear as soon as the QUOTE is set to ACCEPTED
1: You can't do this without a custom controller unfortunately, unless one object is related to the other and you're just happy displaying it as a related list on the parent object's page. For calculations you could use rollup summaries for some basic sums etc..
As for a custom controller, have a look at field sets for a super easy way to get fields into a VF page, you essentially configure groups of fields on your objects and then you can stick those groups onto a page with minimal markup.
2: For fields with complex calculations you'll want to do the sums in the controller and then expose the results through variables onto the page in the usual manner.
3: Not really possible without creating a custom edit page in the first place — you'd be better off having a button on the quote page to open up the Visualforce page, that page can simply display an error if the quote is not yet accepted. There are some other alternatives that might work though, like using a forumla field to generate a link to the page when the status is as you desire.
I'm happy to elaborate on any of this, but the fact that you're asking about number 2 would suggest to me that you don't have much experience developing on the platform (not a dig, just an observation), so unless you're comfortable coding in other environments you could find this quite tricky. That said, you're on stackoverflow so I'm thinking you probably know a little about coding at least!

Resources