I have a Shopping Cart Data and this Data I want to send the review Page . How to do it? - react-router-dom

Note : I am using react app . I want to create like this https://ema-john.firebaseapp.com/review website. Thank you.

Related

How to Get Cart Data in NetSuite SiteBuilder Application

I am new in NetSuite Development.
I want to fetch list of product which are added in the cart to show Short Summary in Header Section. Like Item thumbnail, qty, and price.
Can anyone help me how to do this, or what I need to read to accomplish this task.
Any Help will be appreciated.
Thanks.
Probably the easiest thing to do is create an SSP application and pull the cart as a JSON object from a cart.ss url.
I know the old reference checkout had a /services/cart.ss file that could be used for this (free bundle from Netsuite)
You may be able to get away with a really simple script for that:
/ssp root url/services/cart.ss
service(request, response){
var session = nlapiGetWebContainer().getShoppingSession();
var orderObj = session.getOrder();
response.setContentType('JSON');
response.writeLine(JSON.stringify({order: orderObj.getFieldValues()}));
}
Then when you've published the SSP application you'd access this as an root relative url from the site.

How to update index page content of shopify store using API like we are update other pages content using shopify admin API

I am developing shopify public app. I just want to know that can I get store home page content for upadte and add new content there.
I am getting all pages details and it contents by using shopify admin API for get page,create page,update page and delete page
like here we use following path for update particular page with page_id
PUT /admin/api/2019-04/pages/#{page_id}.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
I had details of all static pages but i don't know how to update home page details like this
Can any one please help me that how I can get home page content and update that content using API or refer me any admin API to get this. Thank you
The smart way to do this is as follows. In the theme itself, you can tell when you are on the index page since Shopify renders index.liquid. In there, you can make a callback to your App using the App Proxy. The App then provides custom data as JSON or perhaps even Liquid. So the index page can now render with your App being part of the cycle.
That is probably the best pattern for you to work with for your specifics.
Finally got the solution to update index.liquid page of shopify store as follow
First you have to get themes by following
GET https://shop_domain/admin/api/2019-04/themes.json
This API give you thmes.json which contains all themes details used in this store.
Now you have to get theme_id from theme.json for update particular page by theme_id.
Update asset API for update content of index page
URL for update assets by theme_id
PUT https://shop_domain/admin/api/2019-04/themes/#{theme_id}/assets.json
require body for update API
{
"asset": {
"key": "templates/index.liquid",
"value": "add your content"
}
}
And this will update index page content with your content . It work successfully for me Thank you

How to share a hyperlink to a parametrized view in reactjs

I created a web-app that uses reactjs. Now the basics of the app are :-
Create Topics/Sub topics.
Display them (this uses react )
Now 2nd task is explained as :-
Show all the topics/sub topics list.
Clicking any of them sends json req and the data is recieved and displayed.
Now I want to share the topic with link , however on clicking any of the topic only one elemnt of the html renders and the url remains the same.
So this is what i want to do -
On clicking , send json req and recieve data ( done )
Change the url ( I want to know if it is possible using the same react page? )

How to include parameters in url using nodejs+jade?

In jade I have two hyper links that both jump to same page, for example:
a(href='/signup')#create-account Create Student Account
a(href='/signup')#create-admin Create Teacher Account
If I want a variable send to '/signup' url and do some processing using that variable, what should I do?
Any help will be appreciated.
It depends on whether you will make your app to be RESTful or not.
Saying you would like to be Restful.
To create an admin you should make a POST to the url /admin.
Respectively to create an account you should post to the url /account.
This is if admin and account are different resources. If it is the same recourse you should post to the original recourse and with the posted data, make the decision what to save where.
jade form:
div.loginbox
form(name="login", action="/signup", method="post")
input(type="checkbox" name="admin")
input(type="text", name="user")
input(type="password", name="pass")
input(type="submit", value="login")

web site scraping through Jsoup

I have spent few hours on signing in to web site by using jsoup. But it always gives same login page. To clarify the issue I tried with facebook site. It also gives same result.
Below I mentioned my code
String url ="http://www.facebook.com/";
Document doc;
doc = Jsoup.connect(url)
.data("email","abc#gmail.com","pass","xyz")
.userAgent("Mozilla").post();
System.out.println(doc);
can anybody point me where I made a mistake and how can i fix this issue?
In data portion "email" and "pass" are input field id of facebook login page.
Thank you.
Try this:
String url ="http://www.facebook.com/";
Document doc;
doc = Jsoup.connect(url)
.data("email","abc#gmail.com")
.data("pass","xyz")
.userAgent("Mozilla")
.post();
Anyway, Jsoup is not bad at all, you only need how to use it properly, but also you need to keep in mind that Facebook is expecting a lot more parameters to make a successfull login via POST emulating a web page navigation.
By example:
charset_test
default_persistent
lgnjs
lgnrnd
locale
lsd
pass
persistent
timezone
If you need to authenticate and get proper data I suggest that you must give a try to a Facebook SDK for Android:
https://github.com/facebook/facebook-android-sdk/

Resources