texts: Magento 2 which of the elements automatically render their children in layout Xml?

texts:
Which two elements automatically render their children in Xml?

<block class=”\Magento\Framework\View\Element\AbstractBlock” name=”shop.info.details”/>
<block class=”\Magento\Framework\View\Element\Template” name=”shop.info.details”/>
<container name=”shop.info.details”/>
<block class=”\Magento\Framework\View\Element\Text\ListText” name=”shop.info.details”/>


texts: Logged in pricing remembered when logged out

texts:
My Magento 1.9.2.3 store has customer groups defined, as we sell to retail customers as well as trade customers.

If a trade customer logs in, they will see their trade pricing on products.
The problem is that after they have logged in once (at some point), and they return to the website some time later but are not logged in, they still see the trade pricing.

Previous version of Magento did not work this way. You were only ever presented with the pricing associated to your customer group, and if you are not logged in, that is the Not Logged In group (standard retail pricing).

Have they changed this in the later 1.9 version, or is this a bug with cookies perhaps?


texts: magento 2: addErrorMessage in cms page not work when enable cache

texts:
I'm trying adderrormessage to the cms page, but I have to disable the cache and it will work. I would like to enable the cache adderrormessage still working.

public function __construct(
    \Magento\Framework\App\Response\Http $response,
    \Magento\Framework\Message\ManagerInterface $messageManager,
    \Vendor\Module\Helper\ModuleConfig $moduleConfig
)
{
    $this->response = $response;
    $this->_messageManager = $messageManager;
    $this->moduleConfig = $moduleConfig;
}

public function addErroMessage(){
    $errorMessage = $this->moduleConfig->getErrorMessage();
    $this->_messageManager->addErrorMessage($errorMessage);
    $pageId = $this->moduleConfig->getPageIdToRedirect();
    $urlPage = $this->helperCmsPage->getPageUrl($pageId);
    $this->response->setRedirect($urlPage);
}

enable cache: not work

disable cache: work

Someone know the answer please help me! Thank you very much!


texts: Is it possible to record product view count while using a full page cache - without the use of hole punching?

texts:
We recently started using a Full Page Cache on our website which basically rendered our old method for tracking product views useless as soon as the page becomes cached. Our old method was basically a code snippet in design/frontend/theme/default/template/catalog/product/view.phtml which was executed on page load.

Now it is possible for me to hole punch this code so that it can run on each page load - I was wondering before doing that if there is a possible alternative method of recording views on the product page whilst using a FPC & without using hole punching?


texts: How make the font of price excl tax the same a incl tax

texts:
I want that price excl tax displays the same as incl tax. I can not find it. Magento 2.2.3

In which CSS file can I change that? The file for standard Magento 2.2.3 is ok!!


texts: How can only developer see an specific frontend on production store Magento 1.9.x

texts:
is there a way to only me see an specific frontend I'm developing?

The store is on production and I have no additional space to create a mirror from this site.


texts: Command setup:di:compile error for Repositories code

texts:
We have developed one Magento2 Website Version - 2.2.1, in every instance - Production, Staging and Local facing the same issue as:

Error while running php bin/magento setup:di:compile

Repositories code generation breaks every time in 14% or 1/7 instance.

Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 56.0 MiB


texts: How to create customer attribute in custom tab Magento 1.9

texts: I have created the custom tab in manage customer section in Magento 1.9. Now I have to create the attribute in my custom tab but don't have any idea how can I manage the attribute please suggest.


texts:
I used Below code for send mail if customer enter Unsupport pincode. It's working fine:

<?php

class Webkul_Mpperproductshipping_Model_Carrier_LocalDelivery extends Mage_Shipping_Model_Carrier_Abstract
{
    /*  Use group alias */
    protected $_code = 'mpperproductshipping';

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        $postCode = $request->getDestPostcode();

        $customer = Mage::getSingleton('customer/session')->getCustomer();
        $name = $customer->getName();
        $email = $customer->getEmail();
        $restrictedCodes = [
            110001,
            110002,

        ]; //restricted values. they can come from anywhere
        if (!in_array($postCode, $restrictedCodes)) {
            $body = 'Hi admin, '
                . 'I am ' . $name . ($email) . ' I try to Place Order with this Pincode ' . $postCode . ' But I cant able to place order please check with it';
            $mail = Mage::getModel('core/email');
            $mail->setToName($name);
            $mail->setToEmail('mymail@gmail.com');
            $mail->setBody($body);

            $mail->setSubject('Not Support Pincode');
            $mail->setFromEmail('domain.com');
            $mail->setFromName($name);
            $mail->setType('html');// You can use 'html' or 'text'

            try {
                $mail->send();
                //Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
                //$this->_redirect('');
            } catch (Exception $e) {
                //Mage::getSingleton('core/session')->addError('Unable to send.');
                // $this->_redirect('');
            }

            return false;

        }

I try to send a mail with shopping cart item also with this code:

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
    $productName = $item->getProduct()->getName();

}

But it show only one items not all items.


texts: Issue with quote (wrong items_count): not possible to delete products

texts:
For some of the products I got the following error while trying to delete them using the backend:

  SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '([DB].q.items_count - 1)'

How can I debug this issue and understand what is the "guilty" code ?
I think I could add some log but I'm not sure where.

Some body claims is M2E to create the wrong quote, but M2E support answered me it is not true.

A possible solution is to act directly on the DB:

UPDATE sales_flat_quote_item qi
INNER JOIN sales_flat_quote q
ON qi.quote_id = q.entity_id
SET q.items_count = 1
WHERE q.items_count = 0
AND qi.product_id = PRODUCT_ID

But this is not exactly a solution ...

Update
After some investigation I found out many people reporting the same issue.
One of the solution proposed it to change the DB:

remove "UNSIGNED" attribute value for column items_count in table sales_flat_quote

is it safe ?


texts: Why is my email template not working with conditionals?

texts:
I need to customise the contact form of our magento project, so that there are 2 different forms, one is a basic contact form, the other one is tailored to specific clients, so they both have really different fields. Since both forms will share the same email template (not sure why magento is built like that, you should be able to set new templates in the admin contacts preferences) i want to use some conditionals. I managed to use DEPENDS to only show the relevant fields, but then all white space from the code would appear in the email, which looks really strange. So i decided to code around using IF, thinking this will take care of the blank lines (still have to prove that though).

Please have a look at the below code and let me know if you can see something strange.
If i take the conditionals out and use DEPEND on each field, it comes to my inbox just fine, but this will not work:

<!--@subject Submitted Form@-->
<!--@vars {
    "var data.name":"Sender Name",
    "var data.email":"Sender Email",
    "var data.telephone":"Sender Telephone",
    "var data.comment":"Comment"
} @-->

{{if data.type}}
   Type: {{var data.type}}
   Name: {{var data.name2}}
   Job Title: {{var data.jobTitle}}
   Company: {{var data.company}}
   Address: {{var data.address}}
   Contact Number: {{var data.contactNumber}}
   E-mail: {{var data.email2}}
   Telephone: {{var data.telephone}}
   Enquiries: {{var data.enquiries}}
{{else}}
   Name: {{var data.name}}
   E-mail: {{var data.email}}
   Comment: {{var data.comment}}
{{/if}}

Can you spot something weird? I can get the email in the ELSE branch, so it looks like the data.type is not getting through? The data.type should work, as it comes for a select in the form:

<select name="type">
    <option value="">Select...</option>
    <option value="Hotelier">I am a Hotelier</option>
    <option value="Retail Customer">I am a Retail Customer</option>
</select>

Any ideas?


texts: purpose of "Catalog Product Rule" and "Catalog Rule Product"

texts:
What exactly is the purpose of the "Catalog Product Rule" and "Catalog Rule Product" indexes?

Which functionalities do they cover?

I am just wondering, because there are often a lot of entries in the backlog of the indexer and we are not using any product rules within Magento that I know of.

Thus I am wondering if I can disable those indexes to make the indexer_update_all_views cron job a little faster.

Update --------------

As answered by Rakesh Donga, "Catalog Product Rule" are the Cart Price Rules and "Catalog Rule Product" are the Catalog Price Rules (awful naming though ;)).

Since we have not defined any such rules in our shop: why are there still so many entries to be indexed for the "Catalog Product Rule" index? Are there base rules that Magento always accounts for?


texts: anyone have idea about Import categories in M2 or is any module available for import category ?


texts: Which Magento 2 directories can I exclude in PhpStorm?

texts:
I'm looking to try and speed up the indexing process in PhpStorm, so I'm looking to find out what directories can I safely ignore without compromising the code completion and hinting.

The only source I have found is here:

https://mirasvit.com/blog/guide-for-setting-up-phpstorm-for-magento-2-developments.html

But I wanted to know if there are other places I can exclude.


texts: How to assign the existing products of one website to another?

texts:
I have a Magento installation which has multiple website.
Now I want to assign some configurable and simple products to the another newly created website which is using same Root category as other websites.

Do I need to reimport the products? or I can map using sku,website and store id?


texts:
I changed my Magento 2 store locale to Russian using the etws/magento-language-ru_ru plugin and the site loading speed significantly increased. Chrome shows that the waiting time (TTFB) is 12-15 seconds at least.

I'm using Apache 2. It server other files in a timely manner. When I use English as the store locale it takes a few seconds to load the page.

How do I fix the problem?

Thank you.


texts: Magento 1.9.2.4 - Cron.php problem with update

texts:
I created a new web site with Magento 1.9.2.4. The old web site is with Magento 1.7. The old website have this problem...it's not always possible see discounted prices if i do not reloading cron.php every time. Now my question is this. This bug that i have with Magento 1.7, with Magento 1.9.2.4 yet it exists or has been fixed? Or it can be due to a problem of my magento? In this last case, how can i do?

Thank you very much.


texts: Magten 1.9 - Onestepcheckout - Success.phtml not working

texts:
Greetings stackoverflow.

I'm helping a friend out with a Magento store. They have recently installed the OneStepCheckout module. Regarding them, after the installation the successpage seems not to work. I have checked in base folder and package folders. There is a success.phtml present in all folders. I have not worked with onestepcheckout before. I can not find a setting in the backend or code, that controls the success page redirect.

The checkout url seems to be wrong as it append and extra "/" - eg. https://www.myshop.dk/onestepcheckout//  <---- notice "//".

Here is my local.xml - https://gist.github.com/andreastherkildsen/7bf10839639b4ff41a12555053fa2e59

Here is onestepcheckout.xml -
https://gist.github.com/andreastherkildsen/00a32dc287a4095be6836f8514f7e841

Can anybody give me a go on what could be missing?

The successpage is blank as shown on the image.


texts:
I am trying to create order programmatically, but i am not able to create order. the below script is not working

    Mage::log($quote, null, 'quote.log', true);
    $service = Mage::getModel('sales/service_quote', $quote);
    $service->submitAll();
    $order = $service->getOrder();

I am getting the data of $quote before object in log file


texts: Magento 2: Call extension on new checkout tab

texts:
To create the new tab on the checkout page I used this link and it is working How to add new steps or tab to the checkout page in Magento2

I want to display this extension on new created tab
magento2-module-delivery-date

Can anyone know how can I call delivery date extension on newly created tab?


texts: Getting a customer custom attribute label not value

texts:
I know I can do the following
    $customerId = 1;
    $customer = $this->customerRepositoryInterface->getById($customerId);
    $code = $customer->getCustomAttribute('attribute_code')->getValue();

But as the attribute is a type of "select" and not "text", it gives me the ID as the value and not the actual label
Therefore how do I get the label/frontend name of the option instead of the ID


texts: Stop Magento from automatically updating Shipping Quote

texts:
Magento's default behavior seems to be to update a shipping quote for every single modification to a shopping cart. I find this very undesirable because it can cause the shopping experience to become unnecessarily slow while Magento waits from quotes from all carriers.

Magento also seems to be very loose on what it calls a "Quote", with there being Sales Quotes and Checkout Quotes. So, even though I have very little experience working with Magento Events, I am having a hard time figuring out where to even start.

How do I stop Magento from getting a shipping quote for every item added or removed from the cart? Just a point in the right direction would be a big help.


texts: Magento 2: Where Does the Error Handler Redirect to the Home Page

texts:
Date: May 27th, 2015 (given the fast changing nature of Magento 2)

For many classes of PHP errors/exceptions in Magento 2, the default system behavior is to redirect the user to the homepage, and rely on the homepage's exception handling code to display the error.

Where does this redirect happen?  Is it in a single place, or are there multiple dispatch loops where it might happen?  The PHP error handler Magento sets

#File: lib/internal/Magento/Framework/App/ErrorHandler.php
public function handler($errorNo, $errorStr, $errorFile, $errorLine)
{
    if (strpos($errorStr, 'DateTimeZone::__construct') !== false) {
        // there's no way to distinguish between caught system exceptions and warnings
        return false;
    }
    $errorNo = $errorNo & error_reporting();
    if ($errorNo == 0) {
        return false;
    }
    $msg = isset($this->errorPhrases[$errorNo]) ? $this->errorPhrases[$errorNo] : "Unknown error ({$errorNo})";
    $msg .= ": {$errorStr} in {$errorFile} on line {$errorLine}";
    throw new \Exception($msg);
}

appears to turn all PHP errors into a global Exception.  This means errors are caught somewhere in the execution chain and a redirect is dispatched -- I'm looking for the spot (or spots) where this catch and redirect behavior happens.


texts:
I want to completely replace the customer account page architecture to be a single page with a bunch of tabs.

Rather than remove/update a bunch of blocks within the existing page, I thought it would be easier and instructive to create a new module and layout.

I followed Alan Storm's awesome tutorial, such that I have an account page for

mycompany.com/mycompany_customaccount/index/index

However, how would I get this to be the default mycompany.com/customer/account page?

Otherwise, I tried

<customer_account_index>
    <update handle="customer_account" />

    <reference name="my.account.wrapper">
        <action method="setTemplate">
            <template>mycompany/custom_account_page.phtml</template>
        </action>
    </reference>
</customer_account_index>

To no avail.

What's the best solution here?


texts:
For my online store, I want to install Facebook messenger bot.

What is the best solution for this? And extension should be free.


texts: Truncate Custom Attribute Label/Options using SQL Query

texts:
I am using Magento 1.9.x.

I have created several custom attributes in Magento project. They all have thousands of labels or options. I don't want to remove custom attribute just want to delete all their values only.

For example I have one attribute as Manufacturer and 1200 options for that attribute now I want to delete all values of Manufacturer Attribute.

How can I do this using SQL queries?

I am following below process

Get attribute_id from Table: eav_attribute by searching attribute_code (In my case it is "manufacturer" and attribute_id is 81)
In table eav_attribute_option, searching 81 under attribute_id field will get us all option_ids
By taking all id's in eav_attribute_option_value, I am searching under option_id and getting value field and removing.

Final Query would be like:

DELETE eav_attribute_option , eav_attribute_option_value  FROM eav_attribute_option  INNER JOIN eav_attribute_option_value
WHERE eav_attribute_option.option_id= eav_attribute_option_value.option_id and eav_attribute_option.attribute_id = 81

To perform such action for multiple Custom Attributes I need to run this query for multiple time.

Any specific solution??


texts: Filter category page products on Sidebar

texts:
I'm currently trying to wrap my head around how I go about allowing my products to be filtered by custom attributes I have set for products. For example, I have a products called Computer 1. It's worth £100.00 and has a 1.2 processor with 1GB of Ram. I also have in the same category another computer called Computer 2, worth £150.00, 1.4 processor and 2GB. How could I list the varying attributes in the sidebar so people can narrow down a huge range of products by individual attributes? For example, if you view the following link:

http://www.pcworld.co.uk/gbuk/laptops-netbooks/laptops/laptops/703_7006_70006_xx_xx/xx-criteria.html

You can see that they allow for people to filter their products by Price, Manufacturer, etc. How would I go about doing that with my products and their attributes. Any help would be really appreciated. I've seen a few tutorials but they seem to want to play with the Mage Controllers, and as I understand it, I'm meant to leave those files of my website alone.

Thanks again.


texts: Magento 2 how to interact with products grid collection

texts:
I'm trying to find the best way to modify products collection for products grid in admin. In particular, to add additional filter to the collection. I don't want to override the grid's block to achieve that. Looks like I'm stuck and cant find a point to start using DI in this case. Also, I can't find any event for loading grid collection as it was in Magento 1.x
If someone has experience in this I would be very appreciate for any info.


texts: Magento 2.3 insert a product into a specific store

texts:
i have Magento 2.3 and i create three different store view with different ID.
After i created a product i can change the price, the name ecc... by the select on the upper-left.
But when i create a product i can't specify where publish it.

For example : i have product A and product B. i have store 1 and store 2. I wanna publish only on store2 the product B.

How can i do it ?

Thanks


texts: Search for my magento returning error. catalogsearch_fulltext is read only

texts: General error: 1036 Table 'catalogsearch_fulltext' is read only. Can't use the search function.


texts: Magento 2 : Customer Import firstname field issue

texts:
I have try to import customer using csv file but each time display error

  Please make sure attribute "firstname" is not empty. in row(s): 1

I have already fill up with firstname entry its not blank but each time they show error for customer import.

Thanks.


texts: how to set up debit card payment method in magento

texts: I don't want to set up using paypal debit. But as there is an option for credit card, I want to include "separate debit card payment method"


texts: How do I add a custom attribute in amount/default.phtml?

texts:
I need to add in a couple of statements using some custom attributes for the Pricing. I am trying to figure out how to allow this to work. Right now I have this:

<?php
    $helper = $this->helper('\Magento\Catalog\Block\Product\View');
    $_product = $helper->$block->getProduct();
?>

<?php if($_product->getData('show_price')): ?>
    <?php if($_product->getPriceInfo()->getPrice('final_price')->getValue() == 0): ?>

<a href="tel:+1<?php echo $storeInfo->getPhone(); ?>">Call for Price!

    <?php else: ?>
        <span class="price-container <?= /* @escapeNotVerified */ $block->getAdjustmentCssClasses() ?>"
                <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
            <?php if ($block->getDisplayLabel()): ?>
                <?= /* @escapeNotVerified */ $block->getDisplayLabel() ?>
            <?php endif; ?>
            <?php if($_product->getData('priced_starting_at')): ?>

Starting at:

            <?php else: ?>

Our Price:

            <?php endif; ?>
            <span <?php if ($block->getPriceId()): ?> id="<?= /* @escapeNotVerified */ $block->getPriceId() ?>"<?php endif;?>
                <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
                data-price-amount="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>"
                data-price-type="<?= /* @escapeNotVerified */ $block->getPriceType() ?>"
                class="price-wrapper <?= /* @escapeNotVerified */ $block->getPriceWrapperCss() ?>"
            ><?= /* @escapeNotVerified */ $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>
            <?php if ($block->hasAdjustmentsHtml()): ?>
                <?= $block->getAdjustmentsHtml() ?>
            <?php endif; ?>
            <?php if ($block->getSchema()): ?>
                <meta itemprop="price" content="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>" />
                <meta itemprop="priceCurrency" content="<?= /* @escapeNotVerified */ $block->getDisplayCurrencyCode() ?>" />
            <?php endif; ?>

    <?php endif; ?>
<?php endif; ?>

This is the error I am getting as of now:

  1 exception(s):
  Exception #0 (LogicException): \Magento\Catalog\Block\Product\View doesn't extends Magento\Framework\App\Helper\AbstractHelper


texts: after migration in magento2 product add to cart error

texts:
I have migrated from Magento 1.9.2.x to Magento 2.2.2 but when I click on the add to cart button, it gives this message:

  We can't add this item to your shopping cart right now.

Please check error in image also:


texts:
I have one issue, I enabled JavaScript merge option in magento backed but iam getting many issues in checkout page. Please see the image. anyone please help.
I need javascript merge because i saw javascript merge issue in page speed.


texts: Get latest product programmatically in magento 2

texts: How to get Latest products in Magento 2 programmatically  in phtml file ?


texts:
I want to add a custom layout xml file to update adminhtml. I have it working now by adding the xml file to app/design/adminhtml/default/default/layout/[module]/custom.xml. I don't like adding this file to the default/default folder however.

Is it possible to add it to [custom]/[theme] instead of default/default ?


texts: Redirecting old domain after copy of live store for dev

texts:
To create test site for copy of live store,

Copy all files (except some media files)
Dump and Import database
Clear all cache (rm -rf newdomain/www/var/*)
Update base url

UPDATE core_config_data SET value="http://newdomain.com" WHERE path=’web/secure/base_url’;

UPDATE core_config_data SET value="http://newdomain.com" WHERE path=’web/unsecure/base_url’;

(also checked select * from core_config_data where path like '%base_url%')

Update local.xml file (for connecting test db, db user, password)
Check root's htaccess file (I even try to delete the file)
Asked server support , they said it's web source problem , not server setting

I think I did everything I know and search to solve! but still when I visit my test website, it still redirect my live web site

Am I missing something? What I should check more?


texts:
Is there is any way to work on magento2 without ssh???

I have a server which don't have any ssh access. So how can i work on there is there is any way>> Please help me


texts: Clicking on color swatch, images are not loading on product listing page in magento 2.3.3

texts:
I have added color swatches for my Configurable products.
On product detail page when we click on color swatches the product images gets changed properly.
But this does not work fine on category pages.
When i click on color swatch, the images does not load.
https://prnt.sc/10gzh73
And it is showing following error on console.
Uncaught TypeError: $(...).AddFotoramaVideoEvents is not a function
    at $.<computed>.<computed>.updateBaseImage (swatch-renderer.js:1254)
    at $.<computed>.<computed>.updateBaseImage (widget.js:100)
    at $.<computed>.<computed>._ProductMediaCallback (swatch-renderer.js:1173)
    at $.<computed>.<computed>._ProductMediaCallback (widget.js:100)
    at Object.mediaSuccessCallback [as success] (swatch-renderer.js:1074)
    at fire (jquery.js:3238)
    at Object.fireWith [as resolveWith] (jquery.js:3368)
    at done (jquery.js:9846)
    at XMLHttpRequest.callback (jquery.js:10317)


texts:
I want to check how many product added and update daily on my catalog using sql query and i want following columns
Sku
Brand
Category
title
product ulr
image url
price
what sql i will write in mysql to get all this information


texts: Magento 2.2.5 - Table catalogsearch_fulltext_scope1 not being automatically generated

texts:
Summary
The exception log becomes bloated with "main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalogsearch_fulltext_scope1' doesn't exist". sometimes reindexing cycle is working properly.but sometime it's not generated/rename from catalogsearch_fulltext_scope1_tmp folder. If we check in database, table is not exist but if you try to create, it will show table is already exists. and if we rename 'catalogsearch_fulltext_scope1_tmp' table to 'catalogsearch_fulltext_scope1', it will show table is already exist. If you try to delete it, it will show table is not exist

Environment
Magento 2.2.5 and possibly earlier versions
PHP 7.0
Custom extensions are installed but are up to date with magento version

Steps to reproduce
1.Check that cron jobs are set up and running
2.Check exceptions log

Expected result
On indexing cycle, no errors should occur.

Actual result
On indexing cycle, error "main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalogsearch_fulltext_scope1' doesn't exist" appears.


texts: How can I export all products that have no images?

texts: I need to export all products without images in my site.


texts: One page checkout page is completely blank. No log errors anywhere

texts: Our Magento version is 1.9. We use a custom theme, but even though Magento can fallback to the Mage core onepage checkout controller, it shows a blank page. Also, there is none logs whatsoever in any of the logs. Nothing in Magento's var/log/exception.log, and var/log/system.log and nothing in PHP's php_error_log. I have traced the cause into the onepage Controller, - the indexAction, and the flow never goes out of $this->loadLayout(); What can cause this?


texts: Webservicex giving wrong EUR:USD conversion

texts:
On our site our base currency is Euro and we have two display currencies, US Dollars & Pound Sterling.

Today, I noticed that the US Dollar rate was the same as the Euro rate, 1:1. This is obviously wrong, todays rate on xe.com is 1:1.06.

We're using Magento 1.9.2.2 and webservicex to update the currency each night at midnight.

Up until today it has worked fine, I can even see from yesterdays orders that it was giving the correct rates. Today it is off, any idea why?

I've checked the historic rates and it has not gone bellow 1:1.06 in a while, I tried getting the exchange rates directly from webservicex but I can't really figure it out. Interestingly the Euro/Sterling rate seems fine!

UPDATE

I found that if I manually update the rates and save them, once I try to import them from webservicex, the new rate is the same as the old rate, which I just manually updated, no matter what number I put in!


texts: Programtically add files to downloadable product

texts:
I'm trying adding some files to downloadable product in magento below in my code.

   $linkfile = array('/magento-dev/media/downloadable/files/link_samples/');
            $samplefile = array();
            $_highfilePath = "/files/link_samples/";
            $_samplefilePath = "/files/link_samples/";
            $paths = array('highurl'=>$_highfilePath,'sampleurl'=>$_samplefilePath);

            $samplefile[] = array(
                    'file' => $_samplefilePath,
                    'name' => 'me.jpg',
                    'size' => '9999',
                    'status' => 'new'
            );

            $linkfile[] = array(
                    'file' => $_highfilePath,
                    'name' => 'me.jpg',
                    'size' => '9999',
                    'status' => 'new'
            );
    $linkFileName = Mage::helper('downloadable/file')->moveFileFromTmp(
                    Mage_Downloadable_Model_Link::getBaseTmpPath(),
                    Mage_Downloadable_Model_Link::getBasePath(),
                    $linkfile
            );
        $linkModel = Mage::getModel('downloadable/link')->setData(array(
                            'product_id' => $product->getId(),
                            'sort_order' => 0,
                            'number_of_downloads' => 0, // Unlimited downloads
                            'is_shareable' => 2, // Not shareable
                            'link_url' => '',
                            'link_type' => 'file',
                            'link_file' => json_encode($linkfile),
                            'sample_file' => json_encode($samplefile),
                            'sample_type' => 'file',
                            'use_default_title' => false,
                            'title' => 'downloadable link',
                            'default_price' => 0,
                            'price'=>0,
                            'store_id'=>$storeId,
                            'website_id'=>$product->getStore()->getWebsiteId(),
                    ));

                    $linkModel->setLinkFile($linkFileName)->save();

I'm not getting what wrong with this I tried finding actual code on magento forums but no luck.

Any idea how to get it work?

Thanks


texts: A status of 500 error occurs in Magento 2.2 production mode

texts:
Yesterday, I switched from developer mode to production mode.

After changing the mode, I used the following command:.

# /usr/local/php71/bin/php bin/magento deploy:mode:set production --skip-compilation
# chown -R fascinate:www-data /var/www/html/primary
# find /var/www/html/primary -type f -print0 | xargs -r0 chmod 664
# find /var/www/html/primary -type d -print0 | xargs -r0 chmod 775
# /usr/local/php71/bin/php  bin/magento setup:upgrade
# /usr/local/php71/bin/php bin/magento setup:di:compile
# chown -R fascinate:www-data /var/www/html/primary
# /usr/local/php71/bin/php bin/magento setup:static-content:deploy
# /usr/local/php71/bin/php bin/magento setup:static-content:deploy ja_JP
# chown -R fascinate:www-data /var/www/html/primary
# find /var/www/html/primary -type f -print0 | xargs -r0 chmod 664
# find /var/www/html/primary -type d -print0 | xargs -r0 chmod 775
# chown -R www-data:www-data /var/www/html/primary/var/session

An error occurred when accessing the front end.

The following contents were written.

2019/06/13 15:46:21 [error] 27980#27980: *40 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected '<' in /var/www/html/primary/var/view_preprocessed/pub/static/app/design/frontend/Infortis/base/Infortis_Base/templates/product/list_featured_slider.phtml on line 1" while reading response header from upstream, client: 51.75.170.163, server: primary.development-ecommerce.com, request: "GET /english/?SID=m5rdn5o00j52d9n0u1ps52mmcu HTTP/1.1", upstream: "fastcgi://127.0.0.1:9071", host: "primary.development-ecommerce.com", referrer: "https://160.16.4.169/english/"

I don't know what the cause is.

Could you help me?


texts: Magento 1.9.2 Upgraded to magento 2 via admin panel

texts: I was reading the upgrade guide - but had the idea to try the upgrade via Magento connect. but is there any chance to update via admin panel


texts:
we are running website Magento 2.2.3 CE version. We are getting an error in cron.log please advise?

cron.log

  Warning: require_once(/srv/public_html/update/vendor/autoload.php):
  failed to open stream: No such file or directory in
  /srv/public_html/update/app/bootstrap.php on line 15

update.log

We did some R&D and found that vendor directory was missing in /srv/public_html/update/ then we have moved vendor directory to respected path now the above error gone but getting below error.

  Update-cron.ERROR: Cron readiness check failure! Found non-writable
  paths

exception.log

  [2019-01-29 06:40:06] main.CRITICAL: No callbacks found
  {"exception":"[object] (Exception(code: 0): No callbacks found at
  /srv/public_html/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:278)"}
  []

How to fix these error? Can any one help?
Thanks


texts:
Path to function in controller is src/app/code/local/Api/LiteGento/controllers/AgentController.php.
Function name is getAuthTokenAction.
I tried go to the mysite.loc/liteGento/agent/getAuthToken, but response is 404.
Where is my mistake?

My controller:

public function getAuthTokenAction() {
        $login = $this->getRequest()->getParam('login');
        $password = $this->getRequest()->getParam('password');

        if(empty($login) || empty($password)) {
            $error = Mage::helper('litegento')->renderError(14);
            $this->renderResponse($error);
            return;
        }

        $agent = Mage::getModel('agent/agent')->getCollection()
            ->addAttributeToSelect(array('auth_token', 'password_hash', 'websiteIds','status'))
            ->addFieldToFilter('email', array('eq' => $login))
            ->getFirstItem();

        if(!$agent->getId()) {
            $error = Mage::helper('litegento')->renderError(21);
            $this->renderResponse($error);
            return;
        }

        if($agent->getStatus() != 1) {
            $error = Mage::helper('litegento')->renderError(24);
            $this->renderResponse($error);
            return;
        }

        if(!in_array(Mage::app()->getWebsite()->getId(), explode(',', $agent->getData('websiteIds')))){
            $error = Mage::helper('litegento')->renderError(22);
            $this->renderResponse($error);
            return;
        }

        $hash = $agent->getPasswordHash();
        if(!$hash || !Mage::helper('core')->validateHash($password, $hash)) {
            $error = Mage::helper('litegento')->renderError(18);
            $this->renderResponse($error);
            return;
        }

        if(!$agent->getAuthToken()) {
            $date = new DateTime();
            $newAuthToken = md5(uniqid($agent->getId(), true).$date->getTimestamp());
            $newAuthToken = substr($newAuthToken, 0, 31);
            $agent->setAuthToken($newAuthToken);
            $agent->save();
        }elseif (strlen($agent->getAuthToken()) > 32){
            $newAuthToken = substr($agent->getAuthToken(), 0, 31);
            $agent->setAuthToken($newAuthToken);
            $agent->save();
        }

        $this->renderResponse(array(
            'Status' => 'SUCCESS',
            'Token'  => 'AuthToken-' . $agent->getAuthToken(),
        ));
    }


texts: Not able to print the Invoice of orders from the admin panel

texts:
I am getting error whenever I tried to print the order's invoice from my admin panel , Please help me how to fix this !!

#0 /home/revsho/public_html/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php(558): Mage::throwException('PDF total model...')
#1 /home/revsho/public_html/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php(579): Mage_Sales_Model_Order_Pdf_Abstract->_getTotalsList(Object(Mage_Sales_Model_Order_Invoice))
#2 /home/revsho/public_html/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php(149): Mage_Sales_Model_Order_Pdf_Abstract->insertTotals(Object(Zend_Pdf_Page), Object(Mage_Sales_Model_Order_Invoice))
#3 /home/revsho/public_html/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php(119): Mage_Sales_Model_Order_Pdf_Invoice->getPdf(Array)
#4 /home/revsho/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php(489): Mage_Adminhtml_Controller_Sales_Invoice->printAction()
#5 /home/revsho/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_Order_InvoiceController->printAction()
#6 /home/revsho/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('print')
#7 /home/revsho/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /home/revsho/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 /home/revsho/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /home/revsho/public_html/index.php(83): Mage::run('', 'store')
#11 {main}


texts:
Which extension of social login is the best for magento1.9. I am trying oneall social login extension but it's getting the error when I click on FB button or G+ button.

kindly suggest me.


texts: Adding AddToCart link to facebook shopping page

texts:
I have a Magento v1.9.2.3 webshop and I'm also adding my products to my Facebook shopping page.

I thought I could use the form action url from my webshop as the payment url in FB shopping: my-webshop/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuc2NyYXB3ZWJzaG9wLm5sL3N0ZXJyZW5iZWVsZC1rbmlwdmVsbGVuLmh0bWw_X19fU0lEPVU,/product/5130/form_key/bO1glkQ2GyvpRd7m/

But after reading I (and trying) I understand the form_key is changed after every cache clear/refresh (which we do very regularly).
So I need a more flexible solution.

How can I solve this? I can't imagine I'm the first to try this. Should I create a new php page that will do this or ... ?

Thanks for any advice.

EDIT

I created a new php page in the root of my webshop and added these lines:

 $product = Mage::getModel('catalog/product')->load(5130);
 echo Mage::helper('checkout/cart')->getAddUrl($product, array('qty'=>1, 'form_key'=>Mage::getSingleton('core/session')->getFormKey()));

The resulting url is my-webshop/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuc2NyYXB3ZWJzaG9wLm5sL0FkZFRvQ2FydC5waHA,/product/5130/form_key/lPCvzei32zLtxqxp/qty/1/ but according to the form url it should be my-webshop/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuc2NyYXB3ZWJzaG9wLm5sL3NhbGUvc3RlcnJlbmJlZWxkLWtuaXB2ZWxsZW4uaHRtbD9fX19TSUQ9VQ,,/product/5130/form_key/kqe8DtKacPrJzjgN/
Notice the difference of the form_key ?!?!?

The resulting URL is not working, but the form url is. So this is not a working solution.

Found something else and added these lines of code:

try {
    $cart = Mage::getSingleton('checkout/cart');
    $cart->init();
    $product = Mage::getModel('catalog/product')->load(5130);

    $parameter = array('product' => '5130',
                'qty' => '1',
                'form_key' => Mage::getSingleton('core/session')->getFormKey()
        );

    $request = new Varien_Object();
    $request->setData($parameter);
    $cart->addProduct($product, $request);
    $cart->save();
    Mage::getSingleton('customer/session')->setCartWasUpdated(true);
    echo 'product added<br>';
} catch (Exception $e) {
  print_r($e->getMessage());
}

product added was printed but when I go to my cart it is still empty.
So this is not working either.

I would really much appreciate if someone would help me out.


texts: magento spam customers registering with chinese and some other languages

texts:
How to prevent spam customers registering with Chinese and some other languages with multiple accounts.

For this I have done input fields not to paste but also other language accounts are being created.

Also planning for google recaptcha but not sure this will this fix the issue.

please help me how to fix this issue.


texts: What is this error and how do you resolve? Transaction ID must not be empty

texts:
Getting an error when submitting a credit card order on Magento site (using Authorize.net payment gateway).

This is the error:

  Transaction ID must not be empty.

Any idea what this error is and how to resolve?


texts: Magento Sample Data on already installed magento

texts:
Just a simple question here. I am using XAMPP(from Bitnami) and as you might know bitnami also  provides magento installation, so i downloaded that exe file and installed magento. Now what i want is to make a tech e-commerce website but i am totally new to this and thus i was watching these youtube videos.

So here is my question: I was wondering that if i could just install that sample data into my current system and just take it out when i am done. But i do not prefer installing, re-installing and uninstalling as because the last time i installed magento (from bitnami) it didn't work so i needed to re-install and this time it luckily did so i do not want to mess it up. So what is the best option available to me?


texts: Magento 2.2.7 - How to change order total value only for payment?

texts:
I'm using installment payment method. So, I need to reduce my order total to send payment only....

I cannot find how Magento managing the order total and provide to third party payment providers.

Can some one provide any suggestions to change this


texts: Throw an error on custom payment checkout

texts:
I am writing a custom checkout module to work with the OnePage Checkout and I want a JavaScript alert to tell the user when their card has been declined or there has been an error with the API. Currently, the PHP processing throws an exception via Mage::throwException, but this does not cause a JavaScript error to pop up.

How can I do this? Is JavaScript code required, or do I need to return a specific data structure in the capture or process function?


texts:
Is there anyway i can hide a product that doesn't have a price or 0 for its price?

We use stock import tools (Magmi Data Importer) and so some products imported don't have a price. How can i check each product has a price and disable it if it doesn't.

I've tried overriding the getStatus() method from Mage Core but this seems to disable the whole product and not just a product which is part of a group.


texts: Magento 2 - Checkout Payment methods does not show

texts:
I have a magento 2 site, with 2 different stores using different themes

1- Theme A
2- Theme B

Theme B is the child of Theme A

In the theme A checkout page, I have been able to display the payment methods, by using the base override of checkout_index_index.xml file . Before this, payment methods were not displayed

created a file

app\design\frontend\Magento\ThemeA\Magento_Checkout\layout\override\base\checkout_index_index.xml

with the following code

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="minicart" />
    <referenceContainer name="header.panel" />
    <referenceBlock name="top.search"/>
    <referenceBlock name="catalog.compare.link" />
    <referenceBlock name="catalog.topnav"/>
    <referenceContainer name="footer-container" />
</body>

This works fine and displays the payment methods properly

For Theme B, I have tried the same approach but it does not work.

I have checked the JS, and it returns me the proper object for the payment methods but they don't get displayed anywhere, it just shows the following message

No payment method


texts: Magento 2.2.1 limited categories in top menu and all categories in left sidebar

texts:
Hy!
I am trying to load in top menu only 4 subcategories and in left sidebar all categories and subcategories. I managed to load only 4 subcategories, but the same is loaded and in left sidebar. I can share the code and any help will be appreciated. Thanks! This is my code and it is located in app/code/Magiccart/Magicmenu/Block/Menu.php:

public function getTreeCategoriesExt($parentId) // include Magic_Label
{
    $categories = $this->_categoryInstance->getCollection()
                    ->addAttributeToSelect(array('name','magic_label','url_path'))
                    ->addAttributeToFilter('include_in_menu', 1)
                    ->addAttributeToFilter('parent_id', $parentId)
                    ->addIsActiveFilter()
                    ->addAttributeToSort('position', 'asc');
    $html = '';
    $counter = 0;
    $allCateg = 'Toate categoriile';
    $categoryObj = $this->categoryRepository->get($parentId);

    foreach($categories as $category)
    {
        $level = $category->getLevel();
        $childHtml = ( $this->_recursionLevel == 0 || ($level -1 < $this->_recursionLevel) ) ? $this->getTreeCategoriesExt($category->getId()) : '';
        $childClass = $childHtml ? ' hasChild parent' : '';
        $childClass .= $this->isCategoryActive($category->getId()) ? ' active' : '';
        $html .= '
getUrl() . '">' . $category->getName() . $this->getCatLabel($category) . "\n" . $childHtml . '
';

        if($counter == 3 && count($categories) > 4) {
            $html .= '
getUrl() . '">' . $allCateg . '
';
        }

        if(++$counter > 3) break;

    }
    if($html) $html = '
' .$html. '
';

    return $html;
}


texts:
I see in transactional email New order template, there is this tag that calls the header html file which is in app/locale/en_US/template/email/html

{{template config_path="design/email/header"}}

I wish to create a new header so I created new file app/local/en_US/template/email/html/header2.html and use code

{{template config_path="design/email/header2"}}

but it does not work. With this code, no header is included in the email. Any ideas why or what is the proper way to create a custom email header?


texts: How to update customized table once payment transaction is successful?

texts: I want to update a customized table when payment transaction is successfully done. Can anyone tell where is the function and how to update?


texts: Show each color of a configurable with size and color on the catalog page?

texts:
How would I take a configurable with options size and color and when on the catalog page have it show not only the configurable product, but also a product for each color it comes in?

I know that it is possible for it to show each simple product on the catalog listing, but but that leads to it showing every product with every products size's.

For example, I have a shirt that comes in black and blue with sizes l,m,s. I want, on the product page, to have it show:

1) Configurable with options black and blue.
2) Black shirt
3) Blue shirt

But not sizes or each simple product. Almost like a mini-configurable.


texts: Product Page 404 error, after moving website

texts:
I have created a testing version of my website, in the same server, but using a different domain name. Frontend and backend works ok, but product pages redirect to

  404 page error

I have tried:

  clearing cache
  reindexing data
  re-save products
  cleared catalog url rewrites
  disabling all third-party modules.
  resetting directory permissions

Nothing worked.

Am I missing something?


texts: Magento separate store by currency but show product in cart with original currency

texts:
I have two store one for USD and one for EURO currency, If a user add a product in usd and one add in EURO, then cart page will show price One in USD and one in EURO with two checkout button, one for USD and one for EURO.

That type scenario possible in magento. Below plugin provide me two checkout button for vendor product.

http://webkul.com/blog/magento-marketplace-split-cart/

I want that type feature without this plugin.

Can we achieve this ? I have a one solution but don't know this the correct  approach or not.

I create a two store for both currency and don't share cart between store and user add both currency product in cart when user come in cart I will customise cart page and get second store product in cart with original currency then make two button for checkout and linked with particular store.

That type approach is correct or not.

Please suggest me.


texts:
How can I import data from my wordpress from magento site ?
Can I import using Wordpress XML feed ?


texts:
Using Magento 2.3.3.  happy_mage300 database in phpmyadmin
There has been an error processing your request
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'happy_mage300.mgpa_msp_tfa_user_config' doesn't exist, query was: SELECT mgpa_msp_tfa_user_config.* FROM mgpa_msp_tfa_user_config WHERE (mgpa_msp_tfa_user_config.user_id='2')


texts:
I have fresh installation of magento 2. I am getting below error :

  /pub/static/adminhtml/Magento/backend/en_US/jquery/jquery-ui-1.9.2.js

net::ERR_ABORTED 404 (Not Found)

Please help me to sort out this problem.


texts: Bootstrap requires JQuery Error - Loaded JQuery But have more errors

texts:
I am trying to use Bootstrap to my custom theme and followed exact instructions in
https://formden.com/blog/isolate-bootstrap
http://marvelcommerce.com/blog/intergrating_bootstrap_with_magento

However, when I load JQuery by having this in Local.xml

<action method="addItem"><type>skin_js</type><name>js/JqueryFile.js</name></action>

I get other errors such as:

prototype.js:5644 Uncaught TypeError: element.attachEvent is not a function
fashion-hub.html:741 Uncaught TypeError: jQuery(...).selectbox is not a function
fashion-hub.html:1221 Uncaught TypeError: jQuery(...).selectbox is not a function
fashion-hub.html:804 Uncaught TypeError: Cannot read property 'down' of undefined
script.js:1533 Uncaught TypeError: jQuery(...).selectbox is not a function
fashion-hub.html:190 Uncaught TypeError: jQuery(...).UItoTop is not a function

Not that I also added

<block type="core/text" name="jquery-noConflict"><action method="setText"><text><![CDATA[<script type="text/javascript">jQuery.noConflict()</script>]]></text></action></block>

to avoid conflicts.

What could have gone wrong with this. I have been trying for 3 weeks and not able to figure it out. Your help will be highly appreciated.

Thanks


texts: Magento 2: custom UrlRewrite Controller Router not works with some handlers

texts:
I'm creating a module to use custom url rewrites. For this I have created a module and I am using a custom UrlRewrite Controller Router.

For testing purpose, I generated the Router below. It works perfectly on handlers like CMS pages and Categories Pages ('hello world' is displayed), but it is not called in the search pages, as if it did not exist.

<?php
namespace Mycompany\Shopby\Controller;

use Magento\Framework\UrlInterface;
use Magento\UrlRewrite\Model\UrlFinderInterface;
use Mycompany\Shopby\Model\Url\Hydrator;

/**
* Class Router
* @package Mycompany_Shopby
*/
class Router extends \Magento\UrlRewrite\Controller\Router implements \Magento\Framework\App\RouterInterface
{

    [ ... consts, protected var, constructor ... ]

    /**
    * Match corresponding navigation URL and modify request
    *
    * @param \Magento\Framework\App\RequestInterface $request
    * @return \Magento\Framework\App\ActionInterface|null
    */
    public function match(\Magento\Framework\App\RequestInterface $request)
    {
        var_dump('hello world');
        die;
    }

Soon on pages like www.mysite.com/category1, hello world is displayed. But on pages like www.mysite.com/catalogsearch/result?q=product, my Router is not called.

In my di.xml I have the following definition of RouterList.

<type name="Magento\Framework\App\RouterList">
    <arguments>
        <argument name="routerList" xsi:type="array">
            <item name="navigationRoute" xsi:type="array">
                <item name="class" xsi:type="string">Mycompany\Shopby\Controller\Router</item>
                <item name="disable" xsi:type="boolean">false</item>
                <item name="sortOrder" xsi:type="string">30</item>
            </item>
        </argument>
    </arguments>
</type>

What do I need to do to get my router to call other handlers like catalogsearch_result_index?


texts: How to get customer orders on the base of customer token in magento 2?Please help me.Thanks in Advance


texts:
By doing some googling I've found this as the only documentation that seemed "official" regarding nginx.

Is it really that the official Magento1 nginx configuration only sits in this quite "obscure" repository? By obscure I mean, not a Magento official one.

What is the most battle tested official goto configuration for Magento1 using nginx?

It should:

Support multi-websites
Be secure
Be in the PHP 5.X branch (the officially supported PHP version).


texts: Magento2 Custom Product Type has no Swatch Image

texts:
I have added custom product types that are based on the simple product and this works.

However I don't get a swatch image option. I can set base, small_image and thumbnail but no swatch. What have I missed?

I have also tried to specifically add 'swatch_image' in my installer but still no joy.


texts: How can i deploy backend only in Magento2

texts:
Is there a way to deploy backend only in magento. As of right now we have Just 2 options available on Magento2 Dev Docs

I'm not sure if we have new options came on 2.1.x, Goal is to save deployment time while i'm only working on backend only.


texts: how to move Recent Orders in dashboard to last

texts:
I want to move recent orders to down exactly where they are at this time. like down side. Currently its like this .

and its code is like this in browser

        Recent Orders

                View All

Recent Orders

                        Order #
                        Date
                        Ship To
                        Order Total
                        Status
                        Action


texts: Unable to run custom js to admin backend

texts:
I have a module with the intention of modifying some elements on a page in the admin backend.

In my module/name/view/adminhtml/layout/default.xml file I have

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <head>
     <script src="module_name::js/priceChange.js"/>
   </head>
</page>

In module_name/view/adminhtml/web/js/priceChange.js

define([
"jquery",
], function(jQuery){
   "use strict";
   (function(e){
    console.log("Message");
    });
});

If I change define to require, it doesn't make a difference.
 And in module_name/view/adminhtml/requirejs-config.js Is have:

var config = {
    map: {
        '*': {
            customAdmin: 'Cubed_AdminStyles/js/priceChange'
        }
    },
    deps: ["jquery"]
};

When I load any page in the backend I am seeing: Uncaught ReferenceError: define is not defined.

Looking at other questions about adding custom javascript, they call the javascript on a phtml page, I don't have that in my module. It will just be that javascript file. This question, makes it seem that you can add the js file without needing to call it on a phtml page, however, I am unable to get it to work.


texts: Magento, how can i edit Additional Info for products

texts:
I need to add product_id to products Additional Info, how can I do this?

I see this,add images to additional info product tab
but I don't understand, how do I choose their product id, and add him to additional info


texts: Magento 2.3.3 Redis overcommit_memory and eviction policy

texts:
Our Magento 2 site has a problem with Redis memory usage/availability. Redis is not able to allocate additional memory and overcommit is turned off. At a seemingly random time, the site will no longer work. A general exception appears and in the report folder the following message is shown

"MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.

The redis server log has the following
Can't save in background: fork: Cannot allocate memory

The redis instance has 18gb maxmemory set and allkeys-lfu as an eviction policy. I don't understand why this policy did not take effect. It should purge the least used keys but instead did nothing and the server crashed.

Today the site was down, but when I logged in, the server had 18 out of 36gb available. (site still down)

I phone rackspace and their senior support said that even though the server had available memory that the kernel was denying the application a specific chunk size of memory. I asked them not to reboot the instance while we investigate but they did anyway. I don't understand, if the server has significant memory available why it is still crashed.

Rackspace solution was to enable redis to overcommit/write to disk. I see this setting is also recommended in the admin documentation for redis, but not understanding the sudden urgency for large chunks of ram and then crashing, and also the eviction policy seemingly having no effect. Setting overcommit just seems like throwing disk at a program that wants gigs and gigs of ram at certain times when it could run for weeks and be fine.

I would like another opinion on the issue. I did not see any unusual activity or spikes in the request log, such as a lot of bot traffic or a scraper.

Magento 2.3.3
Server has 36gb of memory. DB is on separate server.
maxmemory = 16GB
maxmemory-policy allkeys-lfu


texts: configurable products not change stock on child select. Is it defaut behavour?

texts:
Is it the default behavour of magento 2.3 when we select a child product to not refresh the stock as the price? Is it something known to solve this issue?
or, any good extension for this?


texts: how to display user define quantity on checkbox in bundel product magento2

texts:
How to display user define quantity on checkbox in bundle product magento2 ?
i want to know which file u change for j.s. if u find the answer please share your code .

enter link description here


texts: mangento 2 Cron Job is not scheduled with fix time

texts:
I want to execute cron every day at 10.05 so i have define crontab.xml as below

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
       <job name="test_cron" instance="Vendor\Module\Cron\Test" method="execute">
            <schedule>5 10 * * *</schedule>
        </job>
    </group>
</config>

and this "test_cron" not iserted in "cron_schedule" table.

Any help would be appreciated!


texts:
Does magento 1.9.x has a production mode? And if yes how do i set Magento 1.9.2.4 to production mode?

I managed to do it for 2.x but i don't see how to do it for 1.9.x :(

Thank you!


texts: Magento 2 Observer class print event data

texts:
I want to preview all the details inside the object such as Order, Customers after saving the event. I tired below way but it not printing the object inside attributes....

Customer Object Magento\Customer\Model\Data\Customer

$order = $observer->getEvent()->getOrder();
$var_dump($order);

and

$customer= $observer->getEvent()->getCustomer();
$var_dump($customer);

also

print_r($customer->debug());


texts: Magento 2 free downloadable product order status closed automatically

texts:
I have free downloadable products on my Magento 2 shop (Magento 2.3.4, Migrated from Magneto 1). If a customer purchases this free downloadable product, he gets a zero subtotal order which I set to status processing via Magento Payment settings automatically. The order is also invoiced automatically, but the order always has status "closed" automatically with a correctly cerated invoice and so the download is not working. There is no credit memo created! This should be the only way to get to the status closed according to the Magento Status scheme.

This behavior was not observed in Magento 1, there it was always ending with status "complete" and the download was enabled automatically.

Any ideas?

EDIT: I just found out this behavior is a known bug: https://github.com/magento/magento2/issues/25177


texts: Customer can't edit his information without entering current password

texts:
I have problem in customer/account/edit/ page the customer can't update his information without fill current password field even if he doesn't checked the change password checkbox, if the customer try to change his date this message will appear "Invalid current password"

Anyone could help me please ?

The codes used

    <input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Change Password')) ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><?php echo $this->__('Change Password') ?>

    *<?php echo $this->__('Current Password') ?>

        <input type="text" disabled class="input-text no-display" name="dummy" id="dummy" />
        <input type="password" disabled title="<?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text" name="current_password" id="current_password" />

        *<?php echo $this->__('New Password') ?>

            <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('New Password')) ?>" class="input-text validate-password" name="password" id="password" />

    *<?php echo $this->__('Confirm New Password') ?>

        <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text validate-cpassword" name="confirmation" id="confirmation" />

//<![CDATA[
    var dataForm = new VarienForm('form-validate', true);
    function setPasswordForm(arg){
        if (arg){
            $('current_password').up(4).show();
            $('current_password').addClassName('required-entry');
            $('password').addClassName('required-entry');
            $('confirmation').addClassName('required-entry');

        } else {
            $('current_password').up(4).hide();
            $('current_password').removeClassName('required-entry');
            $('password').removeClassName('required-entry');
            $('confirmation').removeClassName('required-entry');
        }
    }

    <?php if($this->getCustomer()->getChangePassword()): ?>
        setPasswordForm(true);
    <?php endif; ?>
//]]>


texts: Magento 2 Migration: Volume Check Failed, Caused by Theme

texts:
I'm migrating my data from Magento 1.9.2.0 to Magento 2.0.0 on a VPS running CentOS 6.7. Everything is going just fine so far and any errors I've received I have been able to resolve. I'm stuck on this one, though.

I'm using a theme by Smartwave called Porto on my Magento 1 site. I don't plan to use this theme on the new site (they have an M2 version). This theme appears to be causing the error, but I don't know what to do.

I'm not sure what this message means or how to fix it:

  Incorrect value: porto/category_attribute_source_tab_mode in:
  eav_attribute.source_model for
  attribute_code=sw_product_staticblock_tab_1`

Thanks in advance!


texts: Current user duration or current user page count in magento 2

texts:
I have a custom module . In my observer i have to know the current user duration & current user ip in fronted . So i write the code for user ip . Now if a user visit my website i want to get is this is the first page he visited in my website.
For example i have home , about, contact page . So when customer first time visit home then i have to get count=1 , if customer visiting about after home page then count =2 , if customer visiting  contact after about then count=3 etc. Is there any method i can get this ?
Or visiting pages i want to know how much duration he is in the website . If the visitor closed window and take the website again the time should start from zero .
I have to solve this question in order to get answer for getStoreCurrency VS getCurrentCurrency ( compare store currency & getCurrentCurrency)
Please help.


texts: Best practice for setting up CRON:INDEX from admin

texts:
Magento Cron for all groups are currently set for Each Minute.
Magento Support recommends this too.
However I am facing Server Slowness issues specially in the admin when this is turned on to each minute.
Once I changed this to every 3 hours the issue got fixed.
Are there any recommendations from the community?
We uplaod around a few hundred SKUs every hour.
Current Version: Magento Cloud Commerce Pro 2.3.4


texts: HELP! Alignment in shopping cart with multiple dropdowns

texts:
HELP! I start my PHP/Magento class in a few weeks, but until then, I could use help. Anyone have time to point me in the right direction here?

I have been researching how to align the shopping cart drop downs/input boxes and haven't been able to find a solution. I would like this to be in the CSS so that when any it is any product, of any quantity the alignment will be correct.

I located where I update this particular page by turning on the template path hints, but think I need to go elsewhere if it's going to be CSS driven. I went into the styles.css and swapped center for left, flushed the cache and no change. I then changed back to keep it the way it was.

Am I in the correct area for this page/cart (for all, actually)? http://awesomescreenshot.com/0963c8xi36

Does anyone have time to look at this code and see what you would suggest? I have attached the code and a screen shot. Do you need anything else to help?

Thanks much! Beth

Here is my code  http://jsfiddle.net/BNeely1101/gzc2th56/


texts: 500 Internal Server Error nginx/1.12.0 on checkout page after Migration from Apache to Nginx

texts:
i'm facing a problem with nginx rewrites after i migrate my Magento website from Apache to Nginx!
When i add a product to the cart and i press the button Place the order is giving me 500 internal server error !
I opened my logs and i can see this error message :

2017/05/26 13:03:39 [error] 48314#48314: *4022 could not find named location "@handler", client: 81.149.36.86, server: abcsports.co.uk, request: "GET /index.php/checkout/onepage/ HTTP/1.1", host: "www.....", referrer: "http://www........"

My conf file is looking like that :

Redirect to www.

server {
    listen 80;
    server_name abcsports.co.uk;
    return 301 $scheme://www.$host$request_uri;
}

Set FPM pool socket for Magento Dashboard, based on adminhtml cookie

map $http_cookie $phpfpm_socket {
  default unix:/var/run/php-fpm/abcsports.co.uk.sock;
  ~adminhtml unix:/var/run/php-fpm/abcsports.co.uk-admin.sock;
}

server {
 listen 80 default_server;
 server_name www.abcsports.co.uk media.abcsports.co.uk skin.abcsports.co.uk js.abcsports.co.uk;
 # root /var/www/vhosts/abcsports.co.uk/httpdocs;
  root /var/www/html/abcsports.co.uk/public_html/;

access_log /var/log/nginx/abcsports.co.uk-access.log;
 error_log /var/log/nginx/abcsports.co.uk-error.log;

client_body_buffer_size 8k;
 client_max_body_size 10M;
 client_header_buffer_size 1k;
 large_client_header_buffers 4 16k;

# SSL Termination
  if ($server_port = 80) { set $httpss off; }
  if ($http_x_forwarded_proto = https) { set $httpss on; }

location / {
  index index.html index.php;
  try_files $uri $uri/ @handler;
  expires 30d;
 }

location ~ ^/(app|includes|media/downloadable|pkginfo|report/config.xml|var)/ { deny all; }

location /. { return 404; }

location @handler { rewrite / /index.php; }
 #location ~ .php/ { rewrite ^(.*.php)/  last; }

location ~ .php$
 {
 #if (!-e $request_filename) { rewrite / /index.php last; }
 expires off;
 fastcgi_pass $phpfpm_socket;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_param MAGE_RUN_CODE default;
 fastcgi_param MAGE_RUN_TYPE store;
 fastcgi_param HTTPS $httpss;
 include fastcgi_params;
 fastcgi_buffer_size 32k;
 fastcgi_buffers 512 32k;
 fastcgi_read_timeout 300;
 }
}

server {
    listen              443 ssl;
    server_name         abcsports.co.uk  www.abcsports.co.uk media.abcsports.co.uk skin.abcsports.co.uk js.abcsports.co.uk;
    root /var/www/html/abcsports.co.uk/public_html/;
    ssl on;
    ssl_certificate     /etc/ssl/certs/abcsports.co.uk.pem;
    ssl_certificate_key /etc/ssl/certs/abcsports.co.uk.key;

access_log /var/log/nginx/abcsports.co.uk-ssl-access.log;
error_log /var/log/nginx/abcsports.co.uk-ssl-error.log;

location / {
 index index.html index.php;
 try_files $uri $uri/ @handler;
 expires 30d;
 }

}

I looked everywhere on the internet and i read a lot of things but didn't find the solution ! I would appreciate any help !
Thank you !


texts: get categories from the specific product in the format of group

texts:
I have to retrieve the category collection in this form

1.For example A is Default category assigned to another category
 DefaultCategoey /Women , Defaut Catgeory/Women/Clothes


texts: Product detail page showing different CSS for different products

texts:
I have product pages showing different 'Add to basket' divs

http://imgur.com/xDFj82B - This is what Magento thinks I want
http://imgur.com/CAG7fcl - This is what I actually want

I've compared these 2 products using Catalogue->Manage products but they seem identical via that.

What has caused the above and more importantly, how do I remove the yellow div in the first image?


texts: create 2 grouped products with different attributes using only one theme

texts:
I want to create grouped products. I will explain my need with examples.

Grouped product 1

Productname  length height price
2             2      2      2

Grouped product 2

Productname  length height width price
2               2    2      2     2

I can create Grouped product 1 and Grouped product 2 by creating attributes "length, height, width "
and by creating 2 themes.

Theme 1 => grouped1.phtml => LENGTH , HEIGHT
Theme 2 => grouped2.phtml => LENGTH , HEIGHT, WIDTH

Is it possible to Create both Grouped Products with only one theme.

Let me know if you need any clarifications.

please help me to find solution.

thanks in advance.


texts: How to reset a specific order by column?

texts:
I have a product collection that use a addAttributeToSort.

Now there exists a sort filter in the frontend to sort products e.g. for price or date.

When I click that filter in the frontend I have to reset my first order by.
But now the problem is I can only reset the order after the frontend runs his new order.

So my question is there a possibility to reset only specific order by columns or can I only reset all order at once?


texts: Is this a correct way change theme programatically via "layout_load_before" event Observer?

texts:
In need to change themes based on customer group.

after some google I found a hook where I can made a change "layout_load_before". I am not sure this is effective solution or not.
I mean here.

Does this will affect theme fallback system of magento2?

Does this effect to full page cache system of magento2?

All I need proper explanation of doing this.

Thanks in advance.


texts:
When I try to decide which costs of shipping I'd like to use I cannot proceed on the onepage checkout...

Debugging says the following:

Do you have any ideas?


texts: Shopping card price rule NOT overriding catalog price rule

texts:
I'm having issues with the catalog price rules not applying the discount correctly and i have figured out that the shopping card rule does what i need to.

Unfortunately even though i have the Shopping cart rule at priority 0 and to Discard subsequent rules and the other at say 10 priority the catalog rule is also applied once added to the cart.

Say we have a product with 10% discount at catalog price rules and another 10% discount at shopping cart rule.

I only want the shopping cart rule to be applied to the product.

Thank you in advance


texts: Show Website Switcher on Header in Magento 2

texts: I need to add website selector on my Magento 2 site header. I am using Magento 2.0.9. How can I implement this?


texts:
I was trying to send by email following to this blog, where they inject transportBuilder object .

public function __construct(
       \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
        \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Escaper $escaper
        ) {
    parent::__construct($context);
    $this->_transportBuilder = $transportBuilder;
    $this->inlineTranslation = $inlineTranslation;
    $this->scopeConfig = $scopeConfig;
    $this->storeManager = $storeManager;
    $this->_escaper = $escaper;
}

but when i try to do the same it says:

Exception #0 (Exception): Recoverable Error: Argument 2 passed to Company\Module\Controller\Index\Index::__construct() must be an instance of Magento\Framework\Mail\Template\TransportBuilder, instance of Magento\Framework\View\Result\PageFactory given

Not sure where im doing wrong .


texts:
please visit this link

http://schoolboards4.newtrendzonline.com/index.php/acrylic-whiteboard-1200-x-1800mm.html  [galarainbow theme]

below under "add to cart " button, you can see

"DETAILS" "UNDEFINED", PRODCUT TAGS UNDEFINEd UNDEFINEd

here, how to remove 3 "UNDEFINED" texts.

please help me to find solution.

thanks in advance.


texts: Magento 2 checkout page keeps on loading.In console,$.event.props is undefined in jquery.mobile.custom.js:44:2.How to clear that?

texts:
I have uploaded Jquery version 3.3.1 in app/design/frontend/theme/vendor/web/js.I have linked it in default_head_blocks.xml.Its working fine for Homepage. But when I proceed to checkout, the page keeps o loading. When I look into the console, there are many JS errors. I have never edited/overwritten any of the files shown in the error.

I tried adding Jquery Migrate from http://code.jquery.com/mobile/git/jquery.mobile-git.min.js in app/design/frontend/theme/vendor/web/js.But it added these errors.

[Show/hide message details.] Error: Mismatched anonymous define() module: function(d){return c(d,a,b),d.mobile}
http://requirejs.org/docs/errors.html#mismatch require.js:166:17
makeError
http://localhost/magento/pub/static/frontend/Canon/CrystalClear/en_US/requirejs/require.js:166:17
intakeDefines
http://localhost/magento/pub/static/frontend/Canon/CrystalClear/en_US/requirejs/require.js:1221:36
localRequire/<
http://localhost/magento/pub/static/frontend/Canon/CrystalClear/en_US/requirejs/require.js:1408:25

Can you please help me. Thanks in advance.


texts: Override Database Credentials with Local.xml?

texts:
I have made multiple attempts to overwrite the Paypal Api Credentials with the local.xml but I can't seem to do it.

I've looked the /Mage/Paypal/etc/config.xml ..which seems to highlight the path. Am I doing something wrong? It would be nice to easily swap paypal configurations with different environments.  OR do we have to force the update in the database?

The most obvious attempt:

<config>
<default>
            <paypal>
                <general>
                    <business_account>email@email.com</business_account>
                </general>
                <wpp>
                    <api_password>test</api_password>
                </wpp>
            </paypal>
        </default>
</config>


texts: How to get customer/guest user email address without using session in magento

texts:
I'm trying to get customer(login)or guest user email address with sales order model, but it reflects blank result . I have been used this code..

$orderData = $observer->getEvent()->getOrder();
            $oincid = $orderData->getIncrementId();
            $order = Mage::getModel('sales/order')->loadByIncrementId($oincid);
            $order->getCustomerEmail();
            echo $order;exit;


texts: Why, Thumbnail placeholder image is not resized in catalog -> product -> edit page in Admin Magento 2.2.5

texts:
I have uploaded Placeholder image in Stores->Configuration->Catalog->Catalog->Product Image Placeholders. but thumbnail image is not resized by default in catalog_prduct_edit page in admin Magento 2.2.5.

Page image is given below


texts: Magento2 - How to add up-sells block in to cart page?

texts:
How to add up-sells block in to cart page for every item?

I have added in checkout_cart_index.xml.

<block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.info.upsell" template="Magento_Catalog::product/list/items.phtml">
            <arguments>
                <argument name="type" xsi:type="string">upsell</argument>
            </arguments>
            <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="upsell.product.addto" as="addto">
                <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                       name="upsell.product.addto.compare" as="compare"
                       template="Magento_Catalog::product/list/addto/compare.phtml"/>
            </block>
        </block>

After that I have called this block in to Magento_Checkout\templates\cart\item\default.phtml but up-sells product not showing
can any one tell best to display up-sells product in cart page for every item after additional info ?


texts: Programmatically assign a product's categories _AND_ sort order/position

texts:
How can I programatically set the categories AND the sort order/position of products? I already have an exisiting script that iterates through my products and assigns the categories

$product = Mage::getModel('catalog/product');
$product->setData($my_array_with_a_lot_of_data_including_arrayCategoryIds);
$product->save();

However, this set's the sort order/position for all products to "1". I also have found this posting
How to update product position (number) in specific category programmatically
but I'd like to avoid loading every single category and do something like

$product->setPosition($my_products_position);

Is there a way that does not require loading every single category?

PS: I want to assign the same position in every category.


texts: How can I get the latest order ID when manipulating the success page? What do I need to implement in my Block in order to get access to the Order factory?


texts: Product before save old related products list

texts:
I created an observer on catalog_product_save_before and want to check if any of the related products have been removed

    $product = $observer->getEvent()->getProduct();

    $product->getRelatedProductCollection();

has the new related products but,

    $product->getOrigData();

Does not seem to have the original related products from before save, is there a way for me to get it?


texts: magento 2 layer navigation in custom collection page and toolbar

texts:
I want to call layer navigation in my custom page

<?php

namespace MPS\Allproduct\Block\Index;

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Block\Product\AbstractProduct;
use Magento\Catalog\Model\Product;
use Magento\Eav\Model\Entity\Collection\AbstractCollection;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Customer\Model\Context as CustomerContext;

class Index extends \Magento\Framework\View\Element\Template {

    protected $urlHelper;
    public function __construct(
        \Magento\Directory\Model\Currency $currency,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        CategoryRepositoryInterface $categoryRepository,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory,
        \Magento\Framework\Url\Helper\Data $urlHelper,
        \Magento\Framework\Data\Form\FormKey $formKey,

        array $data = []
    )
    {
        $this->_categoryFactory = $categoryFactory;
        $this->_currency = $currency;
        $this->_catalogLayer = $layerResolver->get();
        $this->_postDataHelper = $postDataHelper;
        $this->categoryRepository = $categoryRepository;
        $this->urlHelper = $urlHelper;
        $this->_productCollectionFactory = $productCollectionFactory;

        $this->formKey = $formKey;
        parent::__construct($context, $data);
    }

    public function getAddToCartPostParams(\Magento\Catalog\Model\Product $_product)
    {
        $url = $this->getAddToCartUrl($_product);
        return [
            'action' => $url,
            'data' => [
                'product' => $_product->getEntityId(),
                \Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED =>
                    $this->urlHelper->getEncodedUrl($url),
            ]
        ];
    }

    public function getNewProductCollection()
    {
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        /*$collection->setPageSize(4);*/

        $collection->setOrder('entity_id','DESC');

        return $collection;

    }
    public function getFormKey()
    {
        return $this->formKey->getFormKey();
    }
}

xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">

    <head>
        <title>Titlename</title>

    </head>

    <body>

        <referenceContainer name="sidebar.main">
            <block class="MPS\Allproduct\Block\Index\Sidebar" name="allproduct_index_sidebar" before="-" template="MPS_Allproduct::allproduct_index_sidebar.phtml"/>
        </referenceContainer>

        <referenceContainer name="content">
            <block class="MPS\Allproduct\Block\Index\Index" name="allproduct_index_index" template="MPS_Allproduct::allproduct_index_index.phtml"/>
        </referenceContainer>

    </body>
</page>

How to achieve this?


texts: Magento 2: AJAX / PHP files Knockout uses for Checkout

texts:
Anyone know what PHP files, or the AJAX scripts, Knockout uses to pull the product data from the database?

Basically, I'm trying to work out how Knockout knows how much product X and product Y are.

Update:
On Checkout, the Summary section displays the cart's contents – the name and qty of each product. I would like to extend this to include more product data – size attribute / color attribute etc.

If someone could point me in the direction in which Knockout is grabbing the name and qty, I'll be able to request further data from the database.


texts: Editing a product's metadescription dynamically

texts: I want to make an automation that takes the web title of a product's page, and write this to the meta description section of the Magento's back end. How would that be posible ?


texts: Magento 2: How to override Related.php class file under Ui/DataProvider folder?

texts:
I just want to rewrite modifyMeta method on vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Related.php file and I have done following things in file but not succeeded.
I have followed the Magento 2: How to override Ui & Component folder files answer, but unable to rewrite the method.
Here steps what I did:

app/code/Custom/Modulename/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <preference for="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related" type="Custom\Modulename\Ui\DataProvider\Product\Form\Modifier\Related"/>
</config>

app/code/Custom/Modulename/Ui/DataProvider/Product/Form/Modifier/Related.php

<?php

namespace Custom\Modulename\Ui\DataProvider\Product\Form\Modifier;

use Magento\Ui\Component\Form\Fieldset;

class Related extends \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related
{

    public function modifyMeta(array $meta)
    {
       echo "In overrided class " , get_class($this);
       die;
    }
}

Note: I am using Magento 2 Enterprise Editions 2.1.7
Any help would be appreciated.


texts: convert amount form one currency to another currency in magento 2

texts:
I need to convert amount from one currency to another currency in magento 2 not from store base currency

$priceCurrencyObject = $objectManager->get('Magento\Framework\Pricing\PriceCurrencyInterface'); //instance of PriceCurrencyInterface

$store = $this->_storeManager->getStore()->getStoreId(); //get current store id if store id not get passed

$rate = $priceCurrencyObject->convert($USDamount, $store, 'INR');

I tried above code it will convert base currency to another currency.

My criteria is I need to mention from currency and to currency.

Is it possible in magento2


texts: Ensure text remains visible during webfont load: Doesn't work on added fonts

texts:
In our Magento build we have a custom theme that uses Luma as a parent.

After doing an Audit in Chrome we get the message Ensure text remains visible during webfont load and it lists the following.

After following instructions online I add the font-display: swap; rule in to app/design/frontend/THEME/VENDOR/web/css/source/lib/_typography.less which results to the below.

The two remaining fonts are ones that I've added inside of app/design/frontend/THEME/VENDOR/web/css/source/lib/_typography.less

.lib-font-face(
    @family-name:'Hurme Geometric Sans 4',
    @font-path: '@{baseDir}fonts/HurmeGeometricSans4/HurmeGeometricSans4SemiBold',
    @font-weight: 600
);

.lib-font-face(
    @family-name:'Hurme Geometric Sans 4 regular',
    @font-path: '@{baseDir}fonts/HurmeGeometricSans4/HurmeGeometricSans4-Regular',
    @font-weight: 500
);

.lib-font-face(
    @family-name:'Hurme Geometric Sans 4 light',
    @font-path: '@{baseDir}fonts/HurmeGeometricSans4/HurmeGeometricSans4-Light',
    @font-weight: 400
);

.lib-font-face(
    @family-name: 'review-stars',
    @font-path: '@{baseDir}fonts/ReviewStars/icomoon',
    @font-weight: normal
);

The fonts work but still I get that message. Can anyone please help me?


texts: How to properly switch the main domain on Magento 1.9?

texts:
We built a new Magento 1.9.4 store installing it fresh on www.mytestdomain.com. I've added and succussfully transferred my 2nd store from our Magento 1.9.1 installation. It worked fine.

Today, I tried to switch the main domain from our Magento 1.9.1 installation = www.myMAINdomain.com to our Magento 1.9.4 install. The way I did that was going into:

System - Configuration - change Configuration Scope = Main Website --) general --) Web --) change Unsecure and Secure URL to:

https://www.myMAINstore.com/

Now we have an issue with SSL certificates which I hope the hosting company will fix but more importantly when going through the order, after selecting the payment option and clicking on the CONTINUE button, the order DOES NOT actually continue to the 5. Order Review page.

Also - the Admin panel is confused - it's still using the old URL of www.mytestdomain.com. How do I properly update the Admin panel URL?

UPDATED on April 17th, 2019: After reading some articles, I disabled Form Key Validation On Checkout in Admin / Security Section and that made the Payment section work once again.
The million dollar question is - is it OK to have the Form Key Validation disabled or do we need to have it enabled and why?


texts:
Currently having to make a decision for Credit Cards payment methods. Current processor (3rd party) uses authorize.net for gateway. I am currently accepting credit cards on my 1.9 site using Auth.net. I am dropping my processor and have narrowed down to Auth.net or Braintree (leaning towards Braintree, cheaper option).
We will be moving to 2.3.5 in the near future was completed. Problem is I don't see an option for Braintree on 1.9 currently, it looks this would eliminate Braintree currently. As for going with Auth.net, there is no option on 2.3.5 beings its deprecated. I do understand there may be an extension, but how secure and how good does it work.
As for as Braintree I have read where it slows down your site drastically during checkout. Another thing I have read that you should not use the included Braintree option in 2.3.5 / 2.4 and download the extension because it was more secured. Having said all this please give me the best choice between the two and experiences. Really want to use the Braintree option if the 1.9 and speed issue can be resolved. Thanks for any guidance


texts: Adding a block to the layered category page

texts:
I'm trying to add a block to a layered category page, and failing miserably.

Here is the layout I am trying:

<catalog_category_layered>
    <reference name="content">
        <block type="core/text" name="catalog.header" template="catalog/category/header.phtml">
    </reference>
</catalog_category_layered>

Can someone explain where I am going wrong please?


texts: How do I create a "Spend and Save" style promotion? 10% off $99, 15% off $149, 20% off $199 with no coupon

texts: I'd like to create a promotion where the customer saves 10% if they spend $99, 15% if they spend $149, and 20% if they spend $199.  It works with just having one of these rules but I'd like to apply all 3 three rules so the customer can save more when they spend more. Can anyone help?


texts: Problem running Shell commands, it just stucks

texts:
When trying to run even simple command like:

php bin/magento cache:clean

It just stucks.
Though some of the command like

php bin/magento cache:disable
php bin/magento cache:enable
php bin/magento index:reindex

do run.
but for the commands, which stucks, when I see the server load keeps increasing to staggering number like form 1% it goes up to 35%

I am not able to find out where is the issue.
in the same installation, I was able to run these commands.

update:if I run the command with memory_limit=-1
the script never seems to end, but if I limit it like
`memory_limit=10G'
I get this error

Running schema recurring...PHP Fatal error:  Allowed memory size of 10737418240 bytes exhausted (tried to allocate 20480 bytes) in /web/vendor/magento/framework/App/State.php on line 152

the relevant code on line 152 reads like this:

 /**
     * Get area code
     *
     * @return string
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getAreaCode()
    {
        if (!isset($this->_areaCode)) {
            throw new \Magento\Framework\Exception\LocalizedException(
                new \Magento\Framework\Phrase('Area code is not set')
            );
        }
        return $this->_areaCode;
    }

and the module which seems responsible for the error, the code looks like this:

class AppState
{
/**
 * @var \Magento\Framework\App\State
 */
protected $state;

/**
 * @param \Magento\Framework\App\State $state
 */
public function __construct(\Magento\Framework\App\State $state) {
    $this->state = $state;
}

/**
 * @return bool
 */
public function isFrontendArea()
{
    try {
        if ($this->state->getAreaCode() == Area::AREA_ADMINHTML) {
            return false;
        }
    } catch (LocalizedException $e) {
        /* Area is not initialized. Do nothing. */
        return true;
    }
    return true;
}

}

I think this info is enough for any expert to find the issue I am facing.

Thanks.


texts:
Magento 2 'Home Page'

throws "Invalid Document Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'" in developer mode

but it's coming fine in production mode.

All other pages (such as http://example.com/admin, http://example.com/contact, http://example.com/catalogsearch/advanced/ ) gives 404 error in both developer and production mode.

Note : above such are done with 'var' and 'pub' directories recursively given 777 permission.

It also gives "SOAP-ERROR: Parsing WSDL: Couldn't load from....." may be because of the same issue.

Though SOAP is enabled, IP in host file is okay but SOAP connection gets failed.

Note:

I already followed the solutions given in magento forums and stackoverflow, stackexchange.. etc, But the problem still persists.


texts: What is the pageId for Customer/Account Page?

texts:
I want to change the landing page for a customer who has an active session to their customer/account page. I set up a conditional in aroundExecute() in app/code/MYNAME/MODULE/Plugin/CMS/Controller/Index.php

<?php
namespace MYNAME\MODULE\Plugin\Cms\Controller\Index;

use Magento\Customer\Model\Session;

class Index
{
    /**
     * @var Session
     */
    protected $session;

    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     * @param Session $customerSession
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        Session $customerSession
    ) {
        $this->objectManager = $objectManager;
        $this->session = $customerSession;
    }

    /**
     * Renders CMS Home page
     *
     * @param string|null $coreRoute
     * @return \Magento\Framework\Controller\Result\Forward
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function aroundExecute(
        \Magento\Cms\Controller\Index\Index $subject,
        \Closure $proceed,
        $coreRoute = null
    ) {

        if ($this->session->isLoggedIn()) {
            $pageId = 5;
            return $this->objectManager->get('Magento\Cms\Helper\Page')->prepareResultPage($subject, $pageId);
        }
        return $proceed($coreRoute);
    }

}

It works great as long as you know the $pageId (Its randomly set to 5 above). However, I cannot find the pageId for the Customer Account page. I can't find anything in the Magento docs nor anywhere online. The examples I have found return pageId for every page I create but returns nothing for pages generated by Magento. What is the pageId? Or is there a better way to approach this problem?


texts:
I recently changed the list of information that's provided to a user within their Account Dashboard.

Within the /theme/template/customer/account/dashboard/info.phtml file I added the following lines above where the Email is shown:

<?php echo $this->__('Username: ') . $this->escapeHtml(Mage::getSingleton('customer/session')->getCustomer()->getUsername()) ?>

<?php echo $this->__('Birthday: ') . $this->escapeHtml ($this->getCustomer()->getDob()) ?>

<?php echo $this->__('Gender: ') . $this->escapeHtml ($this->getCustomer()->getGender()) ?>

The username works fine, as do the Birthday and Gender codes. However, the Birthday and Gender are presented as they are shown in the database.

Birthday is YYYY-MM-DD HH:MM:SS

Gender is 1 or 2 since the value in the database is INT instead of text.

Is there any way I can change how these are displayed within info.phtml without changing fields in the eav_attribute table?

For instance, MM-DD-YYYY and Male or Female?


texts: Getting error while placing order in Magento 2

texts:
I'm getting intermittent error while placing order. I'm trying to add a Configurable product along with bundle product and a simple product.
While adding the above same product around 10 times and placing the order 10 times, I get below error around 4-6 times and rest of the time the order gets placed without any error.

Fatal error: Uncaught Error: Call to undefined method Magento\Bundle\Model\Product\Type::getConfigurableAttributeCollection() in /var/www/html/Magento/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php:52 Stack trace: #0 /var/www/html/Magento/vendor/magento/module-configurable-product/Model/Product/ReadHandler.php(48): Magento\ConfigurableProduct\Helper\Product\Options\Loader->load(Object(Magento\Catalog\Model\Product\Interceptor)) #1 /var/www/html/Magento/vendor/magento/framework/EntityManager/Operation/Read/ReadExtensions.php(48): Magento\ConfigurableProduct\Model\Product\ReadHandler->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array) #2 /var/www/html/Magento/vendor/magento/framework/EntityManager/Operation/Read.php(117): Magento\Framework\EntityManager\Operation\Read\ReadExtensions->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array) #3 /var/www/html/Magento/vendor/magento/framework/EntityManager/EntityManager.php(61): Magento\Framework\EntityManager\Operation\Read in /var/www/html/Magento/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php on line 52


texts: Magento redirects to Homepage when i search for products Using REST tokens

texts:
I have searched for the products like this localhost/api/rest/products

But it is directly redirecting to Homepage of localhost. I have generated all the keys and tokens and i tried this also: 127.0.0.1/rest/api/products