Any clue on how can I keep a track regarding how many Freestanding Coupons were used in Oracle ATG? I know that for bulk vouchers we have the Redemption Rate, but for the simple vouchers there's no such thing.
For example I created 500 vouchers with the code XXXXX and I want to see how many were used during the checkout.
Cheers
One way to do this would be to use the dyn/admin to query the number of uses for the given voucher code:
Open the ClaimableRepository in dyn/admin http://your-host-name:your-port/dyn/admin/nucleus/atg/commerce/claimable/ClaimableRepository/
In the text area below Run XML Operation Tags on the Repository enter the following:
<print-item item-descriptor="PromotionClaimable" id="my-promotion-id" /> and hit the 'enter' button. This will print something like this:
------ Printing item with id: my-promotion-id
<add-item item-descriptor="DeployablePromotionClaimable" id="my-promotion-id">
<set-property name="expirationDate"><![CDATA[11/26/2015 23:59:00]]></set-property>
<set-property name="displayName"><![CDATA[10% discount on my items]></set-property>
<!-- rdonly derived <set-property name="derivedDisplayName"><![CDATA[10% discount on my items]]></set-property> -->
<set-property name="uses"><![CDATA[4]]></set-property>
<!-- export is false <set-property name="version"><![CDATA[13]]></set-property> -->
<set-property name="lastModified"><![CDATA[10/28/2015 16:18:09]]></set-property>
<set-property name="status"><![CDATA[claimed]]></set-property>
<set-property name="startDate"><![CDATA[8/13/2015 00:00:00]]></set-property>
<!-- rdonly derived <set-property name="hasPromotions"><![CDATA[true]]></set-property> -->
<set-property name="promotions"><![CDATA[promo100001]]></set-property>
<set-property name="type"><![CDATA[DeployablePromotionClaimable]]></set-property>
</add-item>
The line <set-property name="uses"><![CDATA[4]]></set-property> tells you how many times that voucher/coupon has been used, which in this case is 4.
UPDATE:
The above method does not work as it returns the total number of coupons available when the promotion is setup. This means the quickest way to get this information would be to query the completed orders which use the coupon.
Related
I am having a strange issue with a Magento data import and was wondering if anyone else had come across this and had possibly found a solution to help diagnose the problem.
I used the Magento Data Migration Tool to migrate data from a Magento 1 instance to an existing Magento 2 instance. The Magento 2 instance already had some data, so this wasn't a fresh copy of everything, I did it in stages, first the orders only, then the customers only, and finally products and categories. I ignored the CMS blocks and pages as those needed to be kept as well as theme and a few other settings and issues (so I only ran migrate:data).
My config file for the data migration looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:noNamespaceSchemaLocation="urn:magento:module:Magento_DataMigrationTool:etc/config.xsd">
<steps mode="data">
<step title="Data Integrity Step">
<integrity>Migration\Step\DataIntegrity\Integrity</integrity>
</step>
<step title="EAV Step">
<integrity>Migration\Step\Eav\Integrity</integrity>
<data>Migration\Step\Eav\Data</data>
<volume>Migration\Step\Eav\Volume</volume>
</step>
<step title="Map Step">
<integrity>Migration\Step\Map\Integrity</integrity>
<data>Migration\Step\Map\Data</data>
<volume>Migration\Step\Map\Volume</volume>
</step>
<step title="Url Rewrite Step">
<integrity>Migration\Step\UrlRewrite\Version191to2000</integrity>
<data>Migration\Step\UrlRewrite\Version191to2000</data>
<volume>Migration\Step\UrlRewrite\Version191to2000</volume>
</step>
<step title="ConfigurablePrices step">
<integrity>Migration\Step\ConfigurablePrices\Integrity</integrity>
<data>Migration\Step\ConfigurablePrices\Data</data>
<volume>Migration\Step\ConfigurablePrices\Volume</volume>
</step>
<step title="Inventory Step">
<integrity>Migration\Step\Inventory\Integrity</integrity>
<data>Migration\Step\Inventory\Data</data>
<volume>Migration\Step\Inventory\Volume</volume>
</step>
<step title="PostProcessing Step">
<data>Migration\Step\PostProcessing\Data</data>
</step>
</steps>
<steps mode="delta">
<step title="Map Step">
<delta>Migration\Step\Map\Delta</delta>
<volume>Migration\Step\Map\Volume</volume>
</step>
<step title="ConfigurablePrices step">
<delta>Migration\Step\ConfigurablePrices\Delta</delta>
<volume>Migration\Step\ConfigurablePrices\Volume</volume>
</step>
<step title="Url Rewrite Step">
<delta>Migration\Step\UrlRewrite\Version191to2000Delta</delta>
<volume>Migration\Step\UrlRewrite\Version191to2000</volume>
</step>
<step title="Inventory Step">
<delta>Migration\Step\Inventory\Delta</delta>
<volume>Migration\Step\Inventory\Volume</volume>
</step>
</steps>
<source>...</source>
<destination>...</destination>
<options>...</options>
</config>
The product and category data safely copied over and I can see them all in the database as well as in the admin. The URL rewrites also work correctly. However, on some (but not ALL) product pages, it displays almost all the product data except the name, but the page title is 404 and it shows the 404 layout and the 404 content, below all the product data (see image).
So, unlike most issues where the product pages are 404ing, I know it's not a URL rewrite issue (as the same happens if I use the absolute Magento paths instead of the URL rewrite paths). I had this happen before on another data import test, and when I looked in the db there were products assigned to old attribute sets that no longer existed, so I deleted them, re-indexed and cleared cache and that fixed it.
I have reviewed and confirmed all attribute sets assigned to products are correct. I have re-indexed, cleared cache multiple times. This fixed a few products but not the majority of them. I believe this is happening due to some incorrect/corrupt data in the db relating to products but I have no idea how to diagnose where/where to look. I can't wipe everything and reinstall as there is data we need to keep.
Has anyone come across this issue before and perhaps found a solution or a good way to figure out what bad data is messing this up?
For anyone else who might come across this issue, I figured out the issue. In the data migration I brought over categories, products, and URL rewrites. The URL rewrites were brought over with the right request paths but their IDs were different so somehow they broke the Magento path and pages were all 404ing.
When I went in to a product, changed the URL key to something else, and then changed it back, it regenerated the correct URL rewrite linked up correctly in Magento and the page worked without 404ing.
This is very frustrating especially because in Magento 2 there is no built in way to regenerate product url rewrites. You have to manually drop all URL rewrites and updated and resave products to regenerate them correctly. Interestingly, I did this on another project where the URL rewrites copied over correctly and worked without issue. I verified on this migration that the url_rewrite table was clear and all the values were imported so there is likely issues with the original Magento 1 url_rewrite content on this particular project that caused this issue.
I am working on making my application scriptable. I struggle with the "whose" filter clause.
I want to make this work, but while name can be used, country can not:
tell application "myapp"
get every city whose name is "Berlin" -- works
get every city whose country is "Germany" -- error -1700 (Can’t make country into type specifier)
end tell
The relevant parts of the sdef look like this:
<class name="application" code="capp">
<cocoa class="NSApplication"/>
<element type="city">
<cocoa key="allCities"/>
<accessor style="index"/>
</element>
<class name="city" code="Citi" plural="cities">
<cocoa class="ScriptableCity"/>
<property name="name" code="pnam" type="text" access="r">
<cocoa key="name"/>
</property>
<property name="country" code="Ctry" type="text" access="r">
<cocoa key="country"/>
</property>
</class>
What must I do to make country work with "whose" as well? Apparently, the "whose" clause wants a type specifier, not a property name, but I can't make sense of this.
I have implemented indicesOfObjectsByEvaluatingObjectSpecifier:, but that only gets called for name, not for country.
Oh, I had it all wrong. My program code is fine. The issue is caused by the fact that I also have a class named country. So AppleScript, looking at the outmost scope for the identifier first, finds the class country and tries to use that for the comparison. Had the error message included the word "class", this would have been easier to detect, probably.
There are now two solutions:
Rename the property in the Sdef so that it does not clash with the class name any more, e.g. to country name.
Use of it in order to change the scope for the lookup of the identifier, like this:
get every city whose country of it is "Germany"
It is also important to make sure that if the same property name is used in several classes, they all use the same 4-char type code. Otherwise this problem can surface as well.
Want to be able to programmatically declare that a FHIR resource conforms to one or more profiles. Especially want to declare conformance to profiles that don't have any extensions, but only restrictions to the resource such as changing the cardinality of an optional property from 0..1 to 1..1 to make it required or restricting a value set/code system.
Want to be able to associate such an assertion to a Resource when it is created (POST operation) as well as after the fact to an existing resource (PUT operation).
This wiki page: http://wiki.hl7.org/index.php?title=Profile_Validation_Tooling suggests using the Category HTTP header but a particular URL is not specified in the example. “Resources are able to declare that they conform to a profile by being "tagged" with the URI that identifies the profile."
Notional profile URL: http://www.hl7.org/fhir/profiles/patient-restriction-profile.xml
For example let's use a simple Patient Resource:
http://www.hl7.org/fhir/Patient/101
<?xml version="1.0" encoding="UTF-8"?>
<Patient xmlns="http://hl7.org/fhir">
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
Mr. John Smith
</div>
</text>
<identifier>
<use value="usual"/>
<label value="MRN"/>
<system value="urn:oid:1.2.36.146.595.217.0.1"/>
<value value="12345"/>
</identifier>
<name>
<family value="Smith"/>
<given value="John"/>
</name>
<active value="true"/>
</Patient>
UPDATE:
Apparently to add a profile to an existing resource you use tag operations with a taglist as body of the POST with special _tags url suffix.
POST http://www.hl7.org/fhir/Patient/101/_tags
Content-Type: application/xml+fhir
<taglist xmlns="http://hl7.org/fhir">
<category term="http://www.hl7.org/fhir/profiles/patient-restriction-profile.xml"
label="Test profile" scheme="http://hl7.org/fhir/tag/profile"/>
</taglist>
To mark the resource, you'd use
Category: [new profile url];scheme="http://hl7.org/fhir/tag/profile";label="name for profile"
Guidance is here: http://hl7.org/fhir/extras.html#tag
and here: http://hl7.org/fhir/http.html#tags
When you send a resource to a server (either using POST/PUT to update it or to the validation endpoint), you as the sender include a Category header with contains the claims you make as a sender about to which profiles the sent data (in this case an Observation) complies. So this category header would contain the url of the profile the Observation conforms to (because you say it's organization's A's BloodPressure)
Category: http://www.organA.com/profiles/our-fhir-profile#bloodpressure; scheme="http://hl7.org/fhir/tag/profile"
Now, of course, organB would send its profiles like so:
Category: http://www.organB.com/profiles/measurements#bloodpressure; scheme="http://hl7.org/fhir/tag/profile"
It could well be that some instances of observations (because A and B have agreed on some overlap) conform to both:
Category: http://www.organB.com/profiles/measurements#bloodpressure; scheme="http://hl7.org/fhir/tag/profile", http://www.organB.com/profiles/measurements#bloodpressure; scheme="http://hl7.org/fhir/tag/profile"
In addition, the server itself may periodically run all instances against all profiles it knows about and add additional claims.
I'm developing a simple Web App which has a simple data from some employees, such as ID, NAME and so on. Thus, I'm using a XML file as my database. Yet, my XML file is sorted by the Employees' ID.
However, I'm using a to select the Employee's Name and show some informations about him/her, but when I created the bindable data through my spark component (I just "drag-and-drop" my XML file into the component), I'd like to show those names sorted by Name and this is my problem.
It's suppose to be a simple code, but I'm in trouble with it... lol!
<s:DropDownList id="ddNome"
labelField="NomeFuncionario" <!-- Employees' Name -->
textAlign="justify"
width="240" height="25"
top="30" horizontalCenter="0"
initialize="sortName(event)" <!-- Trying to create it now... -->
creationComplete="cbNome_creationCompleteHandler(event)"
change="cbNome_changeHandler(event)">
<s:AsyncListView list="{getDataResult2.lastResult}"/>
</s:DropDownList>
I'd be really grateful for any help with this code.
you can try something like this
<mx:XMLListCollection id="xmlListColl"
source="{getDataResult2.lastResult}">
<mx:sort>
<mx:Sort>
<mx:fields>
<mx:SortField id="sortField"
name="#NomeFuncionario"
caseInsensitive="true" />
</mx:fields>
</mx:Sort>
</mx:sort>
</mx:XMLListCollection>
...
<s:AsyncListView list="{xmlListColl}"/>
...
Google checkout is having an issue with dynamic merchant shipping callback calculation.
When customer click on the checkout with google button, I pass in the shipping method called "default shipping" and shipping cost is $100.
This default value will only show to customer when he selected shipping address and google callback to merchant site to fetch shipping method fail.
When customer login to google account and entered the shipping address (country/city/state/postcode...) , google will do an instant callback to merchant script to fetch the latest shipping method available.
I able to have google callback to me successfully, but my shipping method to google is not accepted.
Example,
When customer selected to ship to US NC, then:
I will return FedEx Economy as shipping method (my system will retrive available shipping method based on address given)
I don't need to show default shipping at all
but google say error below:
Merchant Calculations: We were looking for data in your merchant-calculation-results, but were not able to find it: result: address-id:209802946439880shipping-name: default shipping when fail
XML received from google instant callback:
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-callback xmlns="http://checkout.google.com/schema/2" serial-number="abd99db3-d3e3-485b-ba9c-75863d02ed65">
<shopping-cart>
<merchant-private-data>
<session-id>f199c97f7fa9b19ade6fa57a17ce79d61508aef4</session-id>
</merchant-private-data>
<items>
<item>
<item-weight value="0.0" unit="LB" />
<tax-table-selector>food</tax-table-selector>
<item-name>Test prod 3</item-name>
<item-description></item-description>
<unit-price currency="USD">1.0</unit-price>
<quantity>1</quantity>
<merchant-item-id>test11</merchant-item-id>
</item>
</items>
<cart-expiration>
<good-until-date>2011-05-20T23:59:59.000Z</good-until-date>
</cart-expiration>
</shopping-cart>
<buyer-id>119687448728341</buyer-id>
<calculate>
<addresses>
<anonymous-address id="209802946439880">
<country-code>US</country-code>
<city>Charlotte</city>
<region>NC</region>
<postal-code>28227</postal-code>
</anonymous-address>
</addresses>
<shipping>
<method name="default shipping" />
</shipping>
<tax>false</tax>
<merchant-code-strings />
</calculate>
<buyer-language>English</buyer-language>
</merchant-calculation-callback>
XML to post to google after merchant script custom shipping calculation done:
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
<results>
<result shipping-name="Fedex Economy" address-id="209802946439880">
<shipping-rate currency="USD">15.20</shipping-rate>
<shippable>true</shippable>
</result>
</results>
</merchant-calculation-results>
So I suspect google must require me to return back the same default shipping name when I post back to google.
I tried it, if return the same default shipping name by modify the shipping amount, it works!
But when I return same default shipping name, at the same time an additional shipping method as FedEx Economy to google, google will reply error saying invalid extra data:
Merchant Calculations: You sent us invalid extra data in your merchant-calculation-results: [address-id: 209802946439880/shipping-name: Fedex Economy ]
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
<results>
<result shipping-name="default shipping" address-id="209802946439880">
<shipping-rate currency="USD">8</shipping-rate>
<shippable>true</shippable>
</result>
<result shipping-name="Fedex Economy" address-id="209802946439880">
<shipping-rate currency="USD">15.20</shipping-rate>
<shippable>true</shippable>
</result>
</results>
</merchant-calculation-results>
How come! Isn't it not practical to have this kind of rules...
When google pass back shipping city/state/postcode/country to me, my system will calculate and return available shipping method(s) only
It means before google let me know the address, I don't even know there is how many shipping method available for the particular customer.
That is how merchant calculated shipping works:
REF: Merchant Calculations API -> Shipping
You must specify a unique name and a
default shipping cost for each
shipping option.
An alternative is for you to collect the zip code prior to sending your customer to Google Checkout. Your system can then pre-determine shipping availability and costs prior to redirecting your customer to Google and pass the shipping options/costs as "flat rate shipping" - this is just a Google Checkout specific term that means "here are the shipping costs for this order" (that you have already pre-calculated some way).
More reference:
Ok to ask for zip code
More forum discussions
Hope this helps...