Picture of Generic Pricing Script | Multi-part CSV Pricing | GT_PR_£_Pricing Scripts_003

Generic Pricing Script | Multi-part CSV Pricing | GT_PR_£_Pricing Scripts_003

This sample product showcases the ability to split pricing data into multiple CSV documents for a single product. Our example CSV's only contain a few entries per CSV, however this functionality is intended for use when the possible configurations number in the thousands. When the configuration of product attributes (such as A & B) are changed, the Infigo system has to look up the updated pricing information from the provided CSV. For very large CSV's (over 1000 entries as a general rule of thumb), this can take a noticable amount of time. By splitting one large CSV into multiple smaller CSV's, we can ensure the loading time is decreased.

Tutorial Video Transcript

A transcript of our tutorial video, ensuring you can find exactly what you need, when you need it.

You can search this page to find the relevant time-stamp in the video. Also, this text can be used as part of the tutorial search feature.

00:00:08:03 - 00:00:09:00
This tutorial

00:00:09:00 - 00:00:13:06
discusses multi-part CSV
pricing capabilities

00:00:13:13 - 00:00:15:19
within generic pricing script.

00:00:16:28 - 00:00:19:06
So for this example, I'll be utilizing

00:00:19:07 - 00:00:23:14
a sample product that we've set up
on one of our storefronts.

00:00:23:25 - 00:00:25:24
You do have the ability to access this.

00:00:25:24 - 00:00:28:26
If you want something to reference, if
you're trying to replicate this behavior.

00:00:29:11 - 00:00:34:19
Just go to
https://training.infigosoftware.com/pricingscripts

00:00:35:01 - 00:00:37:22
and the product you're looking for
is multipart

00:00:37:22 - 00:00:40:27
CSV pricing scripts.

00:00:41:03 - 00:00:43:07
This product
contains a few different parts.

00:00:43:07 - 00:00:47:07
One of them of the top section
here is a description of what

00:00:47:07 - 00:00:51:00
this product covers and how it's utilized,
along with a couple of images.

00:00:51:20 - 00:00:57:00
Then you've got a sample configuration
of the pricing scripts.

00:00:57:00 - 00:01:00:25
So the generic pricing script
will go into this in more detail later on.

00:01:02:10 - 00:01:02:16
You've

00:01:02:16 - 00:01:05:16
got visual representations
of the CSV documents

00:01:05:16 - 00:01:07:24
that have been utilized
in this particular product.

00:01:09:00 - 00:01:11:15
And then right at the bottom,
you've got this actually in action.

00:01:11:15 - 00:01:13:20
So the ability to switch between

00:01:15:00 - 00:01:16:28
different attribute combinations

00:01:16:28 - 00:01:21:18
and draw in different prices.

00:01:24:04 - 00:01:25:29
So our sample CSVs

00:01:25:29 - 00:01:30:23
for this particular demonstration
only contain a few entries each.

00:01:31:03 - 00:01:34:17
However, this functionality is intended
for use when possible

00:01:34:17 - 00:01:38:02
number of configurations
for a product number in the thousands.

00:01:39:09 - 00:01:42:20
So the way this works,
when the configuration

00:01:42:20 - 00:01:47:15
of product attributes such as A and B
that we've got in here or changed

00:01:47:27 - 00:01:52:13
the Infigo system has to look up
the updated price information

00:01:52:18 - 00:01:56:23
from the provided CSV for very large CSVs.

00:01:56:23 - 00:02:00:10
And we're talking here
about over a thousand entries.

00:02:00:10 - 00:02:02:18
For example, as a general rule of thumb.

00:02:02:18 - 00:02:04:27
This can take a noticeable amount of time.

00:02:05:20 - 00:02:10:05
So by splitting one large CSV
into multiple smaller

00:02:10:05 - 00:02:14:03
CSV documents, we can ensure that
this loading time is decreased.

00:02:14:12 - 00:02:24:27
And this is what we'll be showing you
how to do in this tutorial.

00:02:26:03 - 00:02:26:15
Okay.

00:02:26:15 - 00:02:27:13
So what we actually mean

00:02:27:13 - 00:02:31:08
by this functionality,
as we've mentioned, is splitting our data

00:02:31:08 - 00:02:35:24
into multiple CSVs for easier access
in our particular example.

00:02:35:25 - 00:02:41:20
It's been split into six different
CSV document, and each of those CSV

00:02:41:20 - 00:02:46:28
documents covers the data
for one selection of the attribute B

00:02:47:26 - 00:02:50:26
So this means that for each of the CSVs,

00:02:51:07 - 00:02:54:23
the value for the B attribute
will be the same throughout.

00:02:55:18 - 00:02:57:18
So I've got two example files open here.

00:02:57:18 - 00:03:01:15
One of them has B one selected
for every option

00:03:01:22 - 00:03:05:13
and one has B two
with every other configuration of A.

00:03:05:29 - 00:03:08:29
So as a result, we've got six CSVs

00:03:09:10 - 00:03:13:15
covering B values from 1 to 6.

00:03:14:26 - 00:03:18:16
Now we must upload these CSVs
into a subdirectory

00:03:18:22 - 00:03:21:08
within our global additional data section.

00:03:21:23 - 00:03:25:12
So we utilize global additional data
in previous tutorials,

00:03:25:21 - 00:03:29:08
but that was just for a single CSV
in order to actually

00:03:29:08 - 00:03:32:29
utilize multiple CSVs
grouped together on one product.

00:03:33:06 - 00:03:35:16
We do need to put them in a subdirectory.

00:03:35:16 - 00:03:38:28
It's simply a case of typing the name
of the subdirectory that you want here

00:03:39:21 - 00:03:40:26
and then clicking on Create

00:03:42:04 - 00:03:43:11
that will create one of these

00:03:43:11 - 00:03:46:13
large icons here
which represent the subdirectories.

00:03:47:04 - 00:03:50:16
You can click on one of those
that is essentially just a file

00:03:50:24 - 00:03:55:29
within a file where you can then upload
those subsequent multiple CSV documents.

00:03:56:16 - 00:04:00:06
So you can see here, for example,
I quoted six CSV documents

00:04:00:11 - 00:04:08:03
within this subdirectory.

00:04:10:03 - 00:04:13:18
Now, in order to utilize the generic
pricing script in this fashion,

00:04:13:25 - 00:04:18:13
the uploaded CSVs
all need to have a matching naming format.

00:04:18:13 - 00:04:20:26
And there's a few things
you need to consider here.

00:04:20:26 - 00:04:24:01
So they all need to have a common file
prefix.

00:04:24:09 - 00:04:28:10
So you can see in this example, they've
all got the prefix of subdirectory,

00:04:28:10 - 00:04:31:20
which is quite confusing
given the name of the subdirectory itself.

00:04:33:10 - 00:04:35:15
You then need a common separator.

00:04:35:19 - 00:04:37:23
So in this case we've got a dash.

00:04:38:22 - 00:04:39:24
It could be an underscore.

00:04:39:24 - 00:04:43:02
It could be an ampersand,
whatever you like.

00:04:43:07 - 00:04:45:14
And then we need a unique suffix

00:04:45:23 - 00:04:49:07
which matches the attribute value
that it's going to be associated with.

00:04:50:04 - 00:04:55:03
So as we've mentioned in our example,
we have A, CSV for each value of B

00:04:55:21 - 00:04:58:15
and that B value can be 1 to 6.

00:04:58:28 - 00:05:02:29
So each file has a different suffix
ranging from 1 to 6.

00:05:03:17 - 00:05:06:02
So for example, subdirectory dash one

00:05:06:24 - 00:05:09:22
will cover all the values

00:05:09:22 - 00:05:12:27
where B is equal to one.

00:05:16:27 - 00:05:19:10
Now we need to continue
to the configuration

00:05:19:10 - 00:05:22:24
in the product variant settings
of the product in question.

00:05:27:07 - 00:05:29:11
So this is the same location
we've seen in previous

00:05:29:11 - 00:05:32:09
tutorials about configuring
the generic pricing script.

00:05:32:26 - 00:05:37:00
And you can see there's a few lines
that we need to consider here from the

00:05:38:00 - 00:05:41:02
example script configuration.

00:05:42:15 - 00:05:45:00
in several entries
in the pricing script configuration.

00:05:45:16 - 00:05:48:15
First of all,
we have the subdirectory line.

00:05:49:15 - 00:05:53:14
So this is a folder that we've created
within Infigo's global

00:05:53:14 - 00:05:57:07
additional data area
in which your partial CSVs will be placed.

00:05:57:20 - 00:05:59:26
So you seen that?
We created that a few moments ago.

00:06:00:04 - 00:06:04:19
You just need to put the name
of that subdirectory in here.

00:06:05:06 - 00:06:07:08
We then have the base file name.

00:06:07:16 - 00:06:09:13
So this is the common prefix

00:06:09:13 - 00:06:13:06
of all of those partial CSVs
that we've uploaded into the subdirectory.

00:06:13:21 - 00:06:17:16
So just put the common prefix here.

00:06:20:04 - 00:06:22:15
We then got the separator.

00:06:22:15 - 00:06:25:08
So this is a common delimiter
located in the name

00:06:25:08 - 00:06:29:16
of all of your partial CSV documents.

00:06:31:11 - 00:06:33:13
And then we have split mapping.

00:06:33:22 - 00:06:36:18
So this is the identification
of the attributes

00:06:36:24 - 00:06:39:04
by which the CSVs are split.

00:06:39:19 - 00:06:42:18
So in our example,
the split mapping is set to be

00:06:42:28 - 00:06:46:10
and as we saw earlier
on, there is a different partial CSV

00:06:46:20 - 00:06:51:04
for each possible value of B attribute.

00:06:51:27 - 00:06:54:06
We also need a line in here
to do with the file path.

00:06:54:10 - 00:06:56:28
Just to make sure
we override this default value

00:06:57:09 - 00:07:00:12
because we're not actually
using one specific CSV here.

00:07:00:12 - 00:07:05:16
We just need to make sure
that that is specified as blank.

00:07:09:09 - 00:07:11:02
So with this in place,
we just need to make sure

00:07:11:02 - 00:07:14:00
we save that configuration

00:07:14:25 - 00:07:16:28
and then we can go ahead and test

00:07:17:00 - 00:07:19:19
that procedure.

00:07:20:13 - 00:07:23:23
Now Test Mode runs
the default configuration of the product

00:07:24:00 - 00:07:28:05
within the admin area and provides
feedback on the data that's returned.

00:07:28:06 - 00:07:31:07
As you can see at the top,
in order to utilize this,

00:07:31:07 - 00:07:35:29
you will need a default configuration
which is expected to return a price.

00:07:36:09 - 00:07:38:24
So for example,
you may have to preselect an

00:07:39:03 - 00:07:41:20
attribute values.

00:07:43:00 - 00:07:44:20
Let's take another look at this
on the front

00:07:44:20 - 00:07:48:12
end of our storefront
just to see it in action.

00:07:49:16 - 00:07:51:25
And what we can see
is a seamless experience.

00:07:51:25 - 00:07:55:01
So there's no indication to the user
that it's using different

00:07:55:01 - 00:07:58:17
CSV files here
or is any different to our other setup.

00:07:59:01 - 00:08:02:26
However,
we do have a faster user experience

00:08:03:00 - 00:08:13:18
because it's now
referencing smaller datasets.

 

Incomplete