texts: How to get all values of a given custom attribute?

texts:
I have a custom product attribute test_id which is a text field. I want to get all the values assigned to this attribute within a given product collection.

I found the following way of doing it. But I need to know if there is a better solution.

public function getAllTestIds() {
    $allValues = array();
    $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
    foreach($collection as $product) {
        $data = $product->getData();
        if(trim($data['test_id']) != '') {
            $allValues[] = $data['test_id'];
       }
   }
return $allValues;
}


texts: Run JavaScript after data-mage-init / mage.apply() has finished loading

texts:
There is a widget loaded by data-mage-init that I need to run code after it has triggered the change event on the product options, why it does this I don't know, I commented out the line that triggers the change event but the module still works perfectly.

I need to alter some other things on the page when the drop downs are changed.  The problem is the drop downs are changed on load because data-mage-init loads this widget which uses trigger() to call the change event on all the select drop downs. I need to define my change events after this runs, otherwise I will have code executing just on page load, instead of when a drop down is changed, which is bad.

I am looking for a simple hook to execute code after ALL mage-init scripts have been looped over and loaded.


texts: Magento 2.0.7 Help with extending a Magento Class

texts:
I extended a class with friendly help of Rakesh after his advice here: Magento 2 (2.0.7) How to edit a a .php file from module-theme for your own theme?

Now after fixing bugs that prevented me from running terminal command setup:upgrade the module if running fine. Unfortunately the original class I wanted to extend, ceased to work now. Regardless of what I put into my topmenu.php, no menu is shown anymore at all. The only change happens when I add an error into it. So at least it is made sure that the script gets attracted.

So now what went wrong? Normally extending a class should mean the original class is unchanged and new functions in the new file are added to it or overwritten when they have the same name. But it seems it does not work this way.

I hope someone knows the answer so I can proceed with it.

Thanks a lot!


texts: Magento2: How to move featured products first in search result?

texts:
I want to sort the product search results by featured attribute(Yes/No type) so featured product comer first then show non-featured products. Currently, my search result is mixing in featured & non-featured items.

Ex: If the user searches the product, search results if any product assigned as featured that products come first and rest of the products after featured products.

Please help me to fix it.


texts: count is not working after filtering the collection

texts:
I am getting the correct count using code.

$this->getCatalogRuleCollection()->count()

But when I am adding the filter to it is not working.
Following code is not working.

$this->getCatalogRuleCollection()->addFieldToFilter('entity_id',$entityId)->count()

Tried getSize() as well, but facing same issue.
Why is this so?
What is the reason for this?
What is the alternative(best method) to getting the count?


texts: How to add in a Flipping Book Publisher html file into the Product Image Section?

texts:
I have the product Flipping Book Publisher and I have created a flipbook.

What I want to know is, is there any way to add this into where the static product image goes?

If not, how can I add this directly beneath the static product image instead of linking using code in the product description to the html file of the flipbook?

Or is it possible to make the static image a hyperlink?

I am still quite new to Magento so please use as much detail as possible. This is for the product pages not the cart page where you view the product.


texts: How to change/edit the wording of dropdown menu "Please select...." from getRegionHtmlSelect()?

texts:
I have a custom module that prompt customer to enter their ship to location (US state). I have implemented and everything is working. The only thing that I want to change is the dropdown menu, it is listing all the US states but there is also a wording "Please select a region, state, or provice."
Is there any way to change this to "Please select a state"?
Below is my code:
phtml file
<?php
$viewModel = $block->getDefaultStatesViewModel();
?>

    Please enter your ship to location:
    <?= $viewModel->getStates() ?>

ViewModel
<?php

namespace Learning\ShiptoModal\ViewModel;

use Magento\Framework\View\Element\Block\ArgumentInterface;

class DefaultStatesViewModel implements ArgumentInterface
{
    /**
     * @var directoryData
     */
    private $directoryData;

    /**
     * DefaultStatesViewModel constructor.
     * @param directoryData
     */
    public function __construct(
        \Magento\Directory\Block\Data $directoryData
    ) {
        $this->directoryData = $directoryData;
    }

    /**
     * @return string
     */
    public function getStates()
    {
        return $this->directoryData->getRegionHtmlSelect();
    }
}


texts:
I need to translate my storefront. I already have ar_SA.csv file in i18n folder in my templatemonster theme folder

How to add translation to my store?


texts: What is wrong with UpgradeData.php script

texts:
I want to add some new category attributes along with a new category attribute group to group them all under.

The upgrade is being ran with no errors but it doesn't seem to run the code even though it looks perfect to me. Am I missing something?

UpgradeData.php

class UpgradeData implements UpgradeDataInterface

{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory) {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function upgrade(ModuleDataSetupInterface $setup,ModuleContextInterface $context)
    {
        $setup->startSetup();

        if (version_compare($context->getVersion(), '1.0.4', '<')) {

            $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

            $eavSetup->addAttributeGroup(
                Category::ENTITY,
                $eavSetup->getDefaultAttributeSetId(Category::ENTITY),
                'Thirdlight Settings',
                99
            );

            $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'thirdlight_banner', [
                'type'     => 'string',
                'label'    => 'Thirdlight Banner',
                'input'    => 'text',
                'source'   => '',
                'visible'  => true,
                'default'  => '',
                'required' => false,
                'global'   => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'group'    => 'Thirdlight Settings',
            ]);

        $setup->endSetup();
    }

Module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Avery_Orderattribs" setup_version="1.0.4">
        <sequence>
            <module name="Magento_Sales"/>
        </sequence>
    </module>
</config>


texts: When re-indexing URL rewrite cache, configurable products get a URL key that looks like a MD5 hash

texts:
I'm using Magento 1.8 alpha 1.
I wrote a shell script that changes some products (and calls save() afterwards).
Now, all the products that were altered have been assigned new URL keys that looks like MD5 hashes.

For example, park.html became 8c82c5200b256e05e3d48496f1c44528.html.

I tried truncating the core_url_rewrite table and re-indexing, but again, all those products still have meaningless URL keys.

If it helps, the products happen to be configurable and visible in both catalog and search.


texts: Magento search not working with - (hyphen)

texts:
I have lot of products with SKU like BM-A395NXIOXSA. When i try to search with the the SKU via search then result is not showing. Can you please help me to resolve this issue?

Thanks in advance.


texts: How to create a Magento2 checkout sign in popup on custom header link?

texts:
I need login popup in the whole website.
How Can I achieve this thing?

Please see the screenshot


texts: How do you create a zip file after developing the module?

texts:
I have been developing WordPress plugin since more than 5 years.

Since all files in WP plugin in one folder, it is very easy to create a zip file.

But it is very different in Magento. After I finish developing the module, how can I create a zip file? I mean my files are in so many folders, It is very difficult to collect them again.

So what method do you use to create a zip file after you develop the module?


texts: Magento 2 addImageToMediaGallery strange behavior

texts:
I've got something strange happening when replacing products images from CLI in Magento2.

The way I do it is the following :

I check if the image already exists in the product (based on the file name).

If ok, I backup information from the image.
I add the new image.
I delete the old one
If I got attributes like small, base or thumbnail, I affect it to my new image (the last inserted).

But sometimes, the $product->addImageToMediaGallery fails without rising any exception. Which is strange.

I just add to add/update thousands of images before launch, and we add lots of them missing.

What happened is that the $product->addImageToMediaGallery failed, so I deleted the existing image, leaving the product without any image !

So I added a test with counting the number of entries in the Media Gallery before and after the addImageToMediaGallery. And then, another strange behavior : the image was, in the end, added to the gallery, but not right away. So my test still shows the same number of entries in the Media Gallery before and after the add, resulting on multiple copies of the image in the product ! (it's in a cron)

My code goes something like this :

    $nbImages = 0;

    // Find the other informations (id, position, actif, label) and count

    $images = $product->getMediaGalleryImages();
    foreach($images as $image){
        $nbImages++;
        if (strpos($image['file'], $nomImage) !== FALSE) {
            $goodImage = $image;
        }
    }

    try {
        $imageTypes = [];
        $product -> addImageToMediaGallery($fullImageName, $imageTypes, TRUE, FALSE);
        $product -> save();
    } catch (Exception $e) {
        // Some personal log function
        $this -> _logs -> addError('Error modifying image '. $fullImageName.' : '. $e -> getMessage());
        return false;
    }

    $productR = $this -> _productRepository -> get($sku);

    $nbImagesAfter = 0;
    $images = $productR->getMediaGalleryImages();

    foreach($images as $image){
        $nbImagesAfter++;
    }

    if ($nbImages == $nbImagesAfter) {
        $this -> _logs -> addError(''Error modifying image '. $fullImageName);
        return false;
    }

I use $productR because, even with $product->save(), if you call back $product->getMediaGalleryImages(), the gallery is always unmodified.

Any idea of what happens ? Is there a sure way to know the add worked or failed ? The function return $this, so the product itself.

Thanks in advance.


texts: I have multiple employees shipping orders. Is there any way to track which user shipped which order?

texts: I have multiple employees shipping and invoicing orders, they each have their own log in. I need a way to figure out what employee shipped what order. Some type of logging extension that I can type in a order number and see who shipped the order and who invoiced it.


texts: How to get site url inside javascript file?

texts:
How to correctly get site url inside js file within magento module?

It should contain protocol (http | https) and domain name.

No path required.

Format http://example.com


texts:
We use an external search system for the search on our website, but when we search the default magento "You've recently viewed" loads and then the search results show. How can we disable the "you've Recently viewed" block from our search page?

I have tried looking in the 2columns-right template which is located within the page folder which is in app -> design -> Theme -> Default -> template ->page  and there is nothing there about the recently viewed products.

Is there a way which we can do this?


texts:
I'm using magento on VPS server 4GB RAM. but my site speed is much much slow.. It takes almost 2 minutes to load

can you plz advice
my website URL is https://muzikhausberlin.de/

i'm using putty shell it also take much time


texts: Minicart qty update Ajax first click not working

texts:
I am using this module https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement for update mini cart qty by ajax.
If i click + button first time its not update qty but in console response true, if click again then the values updated, how to solve this issue.
What are all the possibilities of error?
How to debug why it's not working on the first time?


texts: How to remove jQuery conflict in magento 2

texts: I am getting a conflict of jQuery and due to this some feature of Magento 2 not working . How can I resolve this issue ?


texts:
I want to implement custom ACL for my custom API. Can someone assist me how to achieve this.

Below is my webapi.xml file content:

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">

    <route url="/V1/mymethod/show/:num1/:num2" method="GET">
        <service class="MyNamespace\CoreApi\Api\CoreApiInterface" method="show"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

</routes>

Now instead of <resource ref="self"/> or <resource ref="anonymous"/>, is there any alternative available which is depends on my custom authentication rather than Magento.

The reason behind this is right now I'm build up custom API in which all of my frontend customer having a unique key say API key (We planned to develop this as well). And using this API key they will able to communicate with my custom API. And according to my requirements, I guess creating consumer key and secret through Magento admin (System > Extensions > Integrations) is not to be the advisable solution.

Is there any possibility to do so with Magento 2?


texts: changing the payment options in Admin does not change them on the front end

texts:
Magento ver. 1.9.1.0.

I go to

  SYSTEM - CONFIGURATION - SALES - PAYMENT OPTIONS

...select the Current Configuration Scope to be "Main website".

Set the SAVED CC Enabled to NO. Successufully save the change (it shows NO when I go out and log back in), delete all Cache and re-index but it still shows up on the front end.

Any guesses why that is?

Thanks,

Allysin


texts: Attribute with this code is not super in row - magento 2

texts: Can't import configurable products in magento 2.1 getting validation error like Attribute with this code is not super in row in configurable variation column


texts:
I need to have unicode urls in Magento 2. I have found this magento issue on github that has 4 commits to make it work.

I know that directly editing them is a very bad practice. What is the proper way of overriding these files?
Is the directory lib considered part of the core? (which i am not supposed to edit under any circumstances). If i upgrade magento, will this folder me overwritten?

The file paths are:

lib/internal/Magento/Framework/App/Request/Http.php
lib/internal/Magento/Framework/Filter/TranslitUrl.php
app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php
app/code/Magento/Cms/Model/ResourceModel/Page.php

Also notice that there is no Magento directory under app/code. Magento code is under vendor directory.


texts: Magento 2 invoice refund rest api ID required

texts:
I am using /rest/V1/invoice/{id}/refund, but it is giving error " ID required"
The json which I am posting is:

  {
  "items": [
    {
      "order_item_id": 2,
      "qty": 40
    }
  ],
  "isOnline": true,
  "notify": true,
  "appendComment": false,
  "comment": {

    "comment": "string",
    "is_visible_on_front": 0
  },
  "arguments": {
    "shipping_amount": 0,
    "adjustment_positive": 0,
    "adjustment_negative": 0,
    "extension_attributes": {
      "return_to_stock_items": [
        0
      ]
    }
  }
}

Which ID is missing?


texts: Magento Connect Manager installation not working

texts:
Logging into the Magento Connect Manager, I've added the Extension Key from Magento Connect, and clicked "Install". For 0.2-0.5 Seconds, the "Please Wait" box flashes up then promptly disappears.

Nothing else happens at all. It happens whichever extension I try to install.

Very odd.

The store is v. 1.8.1.0 installed on CentOS

Could any body shine any light upon this at all, or suggest where I might look for more information.


texts: How to create a custom module for crud operations in the step by step in frontend of magento2.3.4?

texts: I am new to magento2. How to implement this task I don't know. Could you please help me?


texts: What factors are used to determine display order when the "Sort By Relevance" option is used while searching in Magento Connect?

texts: I want to understand the logic or algorithm behind the search functionality in Magento Connect when the Sort by option in Refine search is set to sort by Relavence


texts: Stop duplicating SEO meta tags while product duplicating

texts: How to stop duplicating only SEO Meta tags when duplicating product in Magento 2. Can someone guide me how to get it?


texts: My shop is Magento 1.3. What is the problem when update to 1.9?

texts:
I am from Brazil and the problem is following:

The site Termall Ice Machine is using Magento version 1.3. But I would like to make a site better.

I am afraid to break up some function of the site, because any people said to me that update can break up functions.

Is it true? What kind of technical problem can happen? I insert mysite here to anybody see where is possible to break up the site and mark.


texts: Add to cart button not showing in product view pages

texts:
In my Magento store add to cart option is showing only registered customers.
the add to cart button is not showing the guest check out. what is the problem and how to solve this issue? I already enable the guest checkout is enabled in my admin panel.

I have used ebajes theme.


texts: Add configurable product to grouped product

texts: I want to add configurable product to grouped product but when I search magento show me only simple product. How to change this?


texts: Redis version requirement for Magento 2?

texts:
I see on M2 requirements page that it says:

  Magento can utilize the following technologies: Redis version 3.0 for page caching and session storage (the latter supported by Magento version 2.0.6 and later only)

I want to clarify if the can is a must, or I can use Redis 2.8.19, which is the standard EPEL version today. Can I use version 2+ or not?


texts: What does it mean when a number is appended to a category?

texts:
I have recently imported with a .csv file with some products to a newly created category (created the category first), and the URL has a number appended to it like:

xxxx.com/catergory/sub-category-5

When I delete the number in the address bar, I get redirected to a different sub-category.

I've been reading about rewrite urls and truncating databases and other scary sounding stuff, but those seems to mostly relate to the products. When selecting a product from the category, it redirects to the product page with a URL like:

xxx.com/product-name

Using Magento 1.8.0.0

What exactly is going on here? Would it most likely be a problem with my import? Or the order in which I did things?

I would like to get rid of the number without having to do another import and re-adding the images.

Thank you.


texts: Class does not exist error after Mysql upgradation in Magento 2.2.4

texts:
Recently we have done Mysql upgradation from 5.6 to 5.7.31 in Magento EE 2.2.4, we have Android application, when logging in to new installed application it is giving error(given below) for first time then second time it's working fine. Please help me to resolve(Now in Production mode)
note: As it is the Live application, I did not do any upgradation or compilaton after mysql upgradation.
report.CRITICAL: Report ID: webapi-602cfd77508a6; Message: Class  does not exist {"exception":"[object] (Exception(code: -1): Report ID: webapi-602cfd77508a6; Message: Class  does not exist at /var/www/html/digitrac.in/vendor/magento/framework/Webapi/ErrorProcessor.php:205, ReflectionException(code: -1): Class  does not exist at /var/www/html/digitrac.in/vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []


texts: Duplicate size swatches on some product pages

texts:
I've got something strange going on here and I can't pinpoint where the problem is.
On some of the products pages I am getting duplicate size swatches

What could be causing this issue? Could it be a misconfiguration of a product?


texts: Magento 2 - Test if Static Block is Enabled in custom template

texts:
In Magento 1.9, I could test if a CMS Static Block was active with the following code:

if ( Mage::getModel('cms/block')->load('block_id')->getIsActive() == 1) {...}

How would I do the same in Magento 2? This is what I've tried so far:

$blockIsActive = $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('7')->getIsActive();
if ($blockisActive == 1){..}


texts: Magento 2 : Cart rule discount applies twice

texts:
Here is the cart rule

I am not sure why it is applying double discount on products
see


texts: How to call a model method from controller in Magento2

texts:
I have a model with namespace Demo\HelloWorld\Model\Customer and model have a function demo() print "Hello World !".

How to call function demo() from Controller with namespace Demo\HelloWorld\Controller\Index ?

I try example here but not working.

  Recoverable Error : Argument 1 passed to
  Demo\HelloWorld\Controller\Index\Index::__construct() must be an
  instance of \Magento\Framework\ObjectManager, instance of
  Magento\Framework\App\Action\Context given


texts: Problem with products image or view. Unable to see the product but when the cursor is hovered it appears

texts:
I am not able to see the product's image in the front end but when I hover the cursor over the product the image just slides in through  the left which looks very bad. Can any one please help me how to fix this problem?

http://www.bonappetit.co.in/

Scroll down to see the products.


texts: magento 2.1 checkout tab "shipping" missing

texts:
I have two sites: local under windows/xampp and remote server under linux with magento 2.1 updated.
Local site has two tabs at checkout - "Shipping" and "Rewiew and payment"

And server site has only one - "Rewiew and payment"

I need to get back "Shipping" tab because I have some functionality there and my shipping methods are invisible.

Please, help to understand what might be different? The thing is I don't know whether this is a magento core changes that came with version 2.1 or admin panel settings. Checkout and shipping settings in admin seems to be similar. I flushed magento cache, cleaned browser cache, upgraded system and static resources, etc.


texts: How can I remove "As low as" in Magento 2.2.4

texts:
Since the upgrade from 2.2.3 to 2.2.4,  I got new function next to the price of each product. Which is: As low as.

How can I remove it? I can't find and option in Admin panel to switch it off.
Any idea how can I disable/remove it?


texts: Magento 2 admin grids are not loading because of getting error in knockout.js

texts:
I have installed new Magento 2.1 its installed successfully.

Frontend is working fine, backend also loading able able to login.

Whenever i going to Admin->Product->Catalog grid is not loading even any grids in admin is not loading like Order Grid, Customer Grid are not loading i have checked console and seen below mentioned error.

knockout.js:2908 Uncaught Error: You cannot apply bindings multiple times to the same element.

I have removed all caching and static data from command line and again run magento admin but its still getting same error.

You help is greatly appreciated. Thanks


texts: How to know which Admin create the order in Magento 2 backend?

texts:
I want to know who create the order.I have 5 Salesman and they have diffrence Admin ID. When customer order from other sale chanels(Facebook chat,...) and our salesman create the order on magento admin backend.

Can I know How many order that this person created for customer?

I just want to track their performance.

Please advice,
Thank you


texts: How to integrate fixer.io currency converter

texts:
We want to enable currency switcher to our store. We checked this tutorial to add currency options http://inchoo.net/magento/how-to-add-currency-selector-to-magentos-header/ But "WebservicesX" is not fetching any rates.

As a different thread mentioned, a solution was to use Fixer.io API. Currency Rate not importing correctly from Webservicex

Does anyone have idea on how to install this API to Magento backend, in order to enable it? )I´ve downloaded all the Git folders there.


texts: How to remove confirm password in magento2?

texts:
How to remove confirm password field in Change password Section in magento2.2.5

I have remove confirm password field in edit.phtml


texts: Magento 2.2.8 : Class Magento\Ui\Block\Wysiwyg\ActiveEditor does not exist

texts:
I have updated from version 2.2.7 to 2.2.8
now I have this error

  Class Magento\Ui\Block\Wysiwyg\ActiveEditor does not exist

in the back-end when I try to access

for example to Categories page.

Can you help me?


texts: How to create Multilanguage Store in magento

texts:
I need to build a website in magento for two country one for uk and one for France.
I need to create multi language web site in magento. I want to know that how to create multi language web site in magento.

I know its can be by locale filder in magento with some csv. but i never used that.
I need to know that how to create multi language store in magento.
pls explain


texts: How can I add custom currency and display it to backend and frontend?

texts:
I have a fresh Magento 2 setup in my system. I want to add custom currency for my store. I have been following the reference link to add it but I didn't get the result from it.

https://community.magento.com/t5/Magento-2-x-Programming/Adding-Custom-Currency/td-p/28967

Here is the code:

vendor/magento/zendframework1/library/Zend/Locale/Data/en.xml

<currency type="ZZZ">
    <displayName>Custom Currency</displayName>
    <displayName count="one">Custom Currency</displayName>
    <displayName count="other">Custom Currency</displayName>
</currency>

vendor/magento/module-directory/etc/config.xml

I added to the $_allowedCurrencies array:

'ZZZ', /*Custom Currency*/

vendor/magento/zendframework1/library/Zend/Locale/Data/root.xml

<currency type="ZZZ">
    <symbol alt="narrow">CC</symbol>
</currency>

vendor/magento/zendframework1/library/Zend/Locale/Data/supplementalData.xml

<region iso3166="150"><!-- Europe -->
    <currency iso4217="EUR" from="1999-01-01"/>
    <currency iso4217="ZZZ" from="2011-04-01"/>
</region>

And in the same file I added to the  section

<info iso4217="ZZZ" digits="2" rounding="0"/>

I refreshed and flushed all caches and the cache container several times and deleted all files in var/cache manually, but the new currency will not appear in the "Allowed Currencies" or the other dropdowns.

Can someone please help me with this?


texts: magento 2.3 render admin panel attribute on product page under Description tag

texts:
I have 4-5 features attributes as feature_1, feature_2 etc in admin for products. I have set their configuration of 'Visible on Catalog Pages Storefront view' as yes.
I want to render features of products for which they conatin values on product page under Description tab .
How can I do this ?


texts: Exception installing Magento2 sample data: SQL Integrity constraint violation

texts:
I am getting the following error while installing Magento2 with sample data. At the last stage i am getting the below error.

Magento only installing this sample data which i have installed through composer there is nothing which i can do on that to modify data. Please suggest some way to finish the installation successfully.


texts: Backend order where customer then makes payment

texts:
Not sure if this is the correct place to ask this or if anyone can point me in the right direction.

I am looking for some kind of plugin that will allow me to create an order on the backend and then email the customer with a link to the new order where they can then go through the checkout process to make payment.

I have been looking for this for a while but either i don't quite know what ti would be called or the solutions are very costly and have many more features that i don't require.

Any help would be greatly appreciated.

Regards,

Martin


texts:
I  currently can't export anything in the grids for products, clients and newsletters in my computer (and from another computer in another state). It downloads properly from my phone.

When I click the export from the grid, the files starts to download but takes a long time waiting and finally fails: https://imgur.com/a/u3pzU

After failing, I can see in the network tab of the browsers webdev toolbar the request, and if I export it as a .har, it shows that the file's contents where downloaded.

This fails in Edge, Chrome and FF.


texts: Magento 2 show product by attributes programmatically

texts:
I want to show the product in the category (Product listing page) with pre-define product attribute custom attributes.

Right now it is showing all product. But I want to show only those product which has product type (Product attribute) saleable.

I don't know how to do that as I am new in Magento 2.


texts:
I received an e-mail from paypal regarding their TLS 1.2 upgrade.

They have an extended page on what to do over here: https://www.paypal.com/us/webapps/mpp/tls-http-upgrade

As mentioned in this document you can do some checks if you have to do some changes. Which I did:

Are you hosted? - Answer: Yes
Does your system support TLS 1.2 and HTTP/1.1. I contacted my hosting about this and they upgraded the system to the latest Curl version. And they said now my system will now support TLS 1.2 and HTTP/1.1
Have tou hard coded an earlier version of TLS and HTTP supported by the Paypal endpoints. I have no idea if this is the case in Magento. But I am still receiving mails from Paypal that action is required. So I guess I am missing something.

Together with the hosting we set up a test file to check if the connection is ok:

Contents of paypaltest.php file:

<?php

$ch = curl_init('https://tlstest.paypal.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSLVERSION, 6);
$data = curl_exec($ch);
curl_close($ch);

echo $data;

?>

Result: PayPal_Connection_OK

I am running Magento 1.9.2.1. I would think this Magento version would include all settings to have PayPal work.

What I would like to know:
- Do I needs some additional installation or version on my hosting?
- Do I need to change some settings in Magento?


texts: How to add integer attribute option value in magento 2?

texts:
I have used below code for add new attribute options in magento 2.

 if (!$optionId) {

            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $attribute_id = $this->getAttribute($attributeCode)->getAttributeId();

            $languageValues[0] = $label;
            $languageValues[1] = $label;

            $attr = $objectManager->create('\Magento\Eav\Model\Entity\Attribute');
            $attr->load($attribute_id);

            $option = [];
            $option['value'][$languageValues[0]] = $languageValues;
            $attr->addData(array('option' => $option));

            $attr->save();

            // Get the inserted ID. Should be returned from the installer, but it isn't.
            $optionId = $this->getOptionId($attributeCode, $label, true);
        }

But its work only when attribute option is alphabet when i am trying with numeric value its not work.


texts: How to check if customer is logged in and get customer Id in magento 2

texts:
How can i check if the customer has logged in to the magento and get the customer details like id, first name, last name, etc.,

I have tried this in 2 ways

1). Using the session in a block as below

protected $_session;
protected $_context;

public function __construct(
    \Magento\Customer\Model\Session $session,
    \Magento\Framework\View\Element\Template\Context $context
) {
    parent::__construct($context);
    $this->_session = $session;
}

public function isCustomerLoggedIn()
{
    return $this->_session->isLoggedIn();
}

public function getCustomerId(){
    return $this->_session->getCustomer()->getId();
}

call to the function isCustomerLoggedIn() gives boolean false and call to getCustomerId() returns NULL.

2). Using Object Manager in layout

$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->create('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
    $customerSession->getCustomer()->getId();
    $customerSession->getCustomer()->getName();
    $customerSession->getCustomer()->getEmail();
    $customerSession->getCustomer()->getGroupId(); // get Customer Group Id
}

This way gave the customer Id, Name, Email, Group Id of the previous logged in customer but not the current customer.

Can any one help to get the currently logged in customer details.


texts:
As I can see the standard Magento 2 convention is for each module to obtain its own API folder which is responsible for CRUD operations. However, I want to discuss this a little bit.
I want to create an API Module which contains only and all of the REST functionality of my whole project, because I don't like the Idea of each module to carry a separate folder with separate files for the 2 API calls that the module needs (A lot of unnecessary folders and files in my opinion).
Does the Magento Framework allows that and if it does, will this have any downside besides the fact the for all my modules to work I will need to have ApiModule installed and enabled.


texts: Not showing my custom api in wsdl(url) and web service list?

texts:
I have created Api in my module, when I accessing through coding it is working fine, but in url (wsdl format) & web services list (Back-End) are not showing. If I give my custom Api to others, it should be in web services list because we will provide permissions for that. So, how can I configure the custom api in wsdl & web service list?

my code is:

local->Course->Mca->etc->api.xml

<?xml version="1.0"?>
<config>
    <api>
        <resources>
            <mca translate="title" module="mca">
                <model>mca/api</model>
                <title>MCA Student Resources</title>
                <methods>
                    <create translate="title" module="mca">
                    </create>
                </methods>
                <faults module="mca">
                    <data_invalid>
                        100

                        <message>Invalid Student data. Details in error message.</message>
                    </data_invalid>

                </faults>
            </mca>
        </resources>
    </api>
</config>

local->Course->Mca->Model->Api.php

<?php
class Course_Mca_Model_Api extends Mage_Api_Model_Resource_Abstract
{
    public function create($stuData)
    {
        return $stuData . ' My Custom Student Message';
    }

    public function info($stuId)
    {
    }

    public function items($filters)
    {
    }

    public function update($stuId, $stuData)
    {
    }

    public function delete($stuId)
    {
    }
}

thanks in advance.


texts: How to store label value in core_config_data

texts:
I want to store label value in core_config_data. Mostly the input values are store. If there is no row then the magento creates it.
But why the label value is not created.

<field id="last_sync" translate="label comment" type="label" sortOrder="9" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Last Sync on </label>
</field>


texts: In Magento 1.9 default cache is set to disabled and am unable to enable the same.


texts: Trying to install extension through Connect Manager getting depends on PHP extensions error

texts:
I am trying to install Magento extension StitchLabs_ChannelIntegration but I am getting this error:

  CONNECT ERROR: Package community/StitchLabs_ChannelIntegration 1.0.8 depends on PHP extensions: Array

My specs:

Magento 1.9.?
New Amazon EC2
Latest httpd and php55w
php -m shows:

  [PHP Modules]
  bz2
  calendar
  Core
  ctype
  curl
  date
  dom
  ereg
  exif
  fileinfo
  filter
  ftp
  gd
  gettext
  gmp
  hash
  iconv
  json
  libxml
  mbstring
  mcrypt
  mhash
  mysql
  mysqli
  openssl
  pcntl
  pcre
  PDO
  pdo_mysql
  pdo_sqlite
  Phar
  readline
  Reflection
  session
  shmop
  SimpleXML
  sockets
  SPL
  sqlite3
  standard
  tokenizer
  wddx
  xml
  xmlreader
  xmlwriter
  xsl
  Zend OPcache
  zip
  zlib

  [Zend Modules]
  Zend OPcache

The only traction that I have made is that I have read that I need to add extension=php_xsl.so in php.ini but I don't have that installed cannot find anywhere to install this extension, only the dll version for windows.

trying to yum install php-xsl outputs:

  Loaded plugins: update-motd, upgrade-helper
  Package php55w-xml-5.5.26-1.w6.x86_64 already installed and latest version
  Nothing to do

and searching for find / -name php_xsl.so outputs nothing

Please help


texts: Is it possible to save attribute value per store in custom eav based model?

texts:
Let's say I have custom EAV entity type with it's tables that have store field (just like catalog/product tables have). Can default EAV resource model save data per store? From what I have seen, in Mage_Eav_Model_Entity_Abstract there is _saveAttribute method (which is used for inserting and updating) which does not create store_id key:

protected function _saveAttribute($object, $attribute, $value)
{
    $table = $attribute->getBackend()->getTable();
    if (!isset($this->_attributeValuesToSave[$table])) {
        $this->_attributeValuesToSave[$table] = array();
    }

    $entityIdField = $attribute->getBackend()->getEntityIdField();

    $data   = array(
        'entity_type_id'    => $object->getEntityTypeId(),
        $entityIdField      => $object->getId(),
        'attribute_id'      => $attribute->getId(),
        'store_id'          => $object->getStoreId(),
        'value'             => $this->_prepareValueForSave($value, $attribute)
    );

    $this->_attributeValuesToSave[$table][] = $data;

    return $this;
}

I have also seen that products use different mechanism for this (in Mage_Catalog_Model_Resource_Abstract):

    protected function _saveAttributeValue($object, $attribute, $value)
{
    $write   = $this->_getWriteAdapter();
    $storeId = (int)Mage::app()->getStore($object->getStoreId())->getId();
    $table   = $attribute->getBackend()->getTable();

    /**
     * If we work in single store mode all values should be saved just
     * for default store id
     * In this case we clear all not default values
     */
    if (Mage::app()->isSingleStoreMode()) {
        $storeId = $this->getDefaultStoreId();
        $write->delete($table, array(
            'attribute_id = ?' => $attribute->getAttributeId(),
            'entity_id = ?'    => $object->getEntityId(),
            'store_id <> ?'    => $storeId
        ));
    }

    $data = new Varien_Object(array(
        'entity_type_id'    => $attribute->getEntityTypeId(),
        'attribute_id'      => $attribute->getAttributeId(),
        'store_id'          => $storeId,
        'entity_id'         => $object->getEntityId(),
        'value'             => $this->_prepareValueForSave($value, $attribute)
    ));
    $bind = $this->_prepareDataForTable($data, $table);

    if ($attribute->isScopeStore()) {
        /**
         * Update attribute value for store
         */
        $this->_attributeValuesToSave[$table][] = $bind;
    } else if ($attribute->isScopeWebsite() && $storeId != $this->getDefaultStoreId()) {
        /**
         * Update attribute value for website
         */
        $storeIds = Mage::app()->getStore($storeId)->getWebsite()->getStoreIds(true);
        foreach ($storeIds as $storeId) {
            $bind['store_id'] = (int)$storeId;
            $this->_attributeValuesToSave[$table][] = $bind;
        }
    } else {
        /**
         * Update global attribute value
         */
        $bind['store_id'] = $this->getDefaultStoreId();
        $this->_attributeValuesToSave[$table][] = $bind;
    }

    return $this;
}

This leads me to believe that it is impossible to make EAV based models with values per store without some overwriting. Since I have seen that people mention that it is possible to do it, I would like someone to clarify this for me.


texts: What ide or tools use for magento formatting?

texts:
I've try netbeans and eclipse with psr2 format configuration but in magento files I've got:

public function __construct(
    \Magento\Framework\App\Helper\Context $context,
    \Magento\Catalog\Model\ProductTypes\ConfigInterface $config
) {
    $this->config = $config;
    parent::__construct($context);
}

In those ides I've got:

1) Netbeans:

public function __construct(
\Magento\Framework\App\Helper\Context $context,
    \Magento\Catalog\Model\ProductTypes\ConfigInterface $config
)
{
    $this->config = $config;
    parent::__construct($context);
}

2) Eclipse:

public function __construct(\Magento\Framework\App\Helper\Context $context,
    \Magento\Catalog\Model\ProductTypes\ConfigInterface $config
)
{
    $this->config = $config;
    parent::__construct($context);
}

And other diff appearances. I'm not believing that not exist tools to format and magento team use PHP-CodeSniffer and then manually format if bug have been founded


texts: I want to send email order confirmation only for status payment complete with Magento 2

texts:
I use Magento 2 for my store and an email order confirmation is send automatically after an order even when the status payment is cancelled, invalid, review...
I want to send an email confirmation only when a payment is completed or processing.

Could you please help me to change the parameter / the configuration to achieve this goal.

Thanks a lot

Majda


texts: Magento 1.9 : How to create our own custom timezone?

texts:
I want to create my own custom timezome in magento at

System -> Configuration -> General -> Locale Options -> Timezone.

Can anyone help me in this ?


texts: Catalog price rules different after updating to 1.9.2

texts:
On 1.9.1.1, catalog price rule condition "Sku contains" works fine and the rule applies to bundle product types.

After updating to 1.9.2 "Sku contains" now means "Sku begins with" (value I enter must be in the beginning of the sku instead of anywhere in the sku) and the rule is not being applied to bundle product types unless I enter the EXACT sku.

Is anybody else having this issue? I confirmed it's an issue after updating because I switched back to 1.9.1.1 and the rules work fine now.


texts: Why are accounts which sign up newsletter during registration has Type as Guest?

texts:
I notice that when a customer signs up a new account and checks the Sign up newsletter option during registration, Magento puts this account under the Marketing > Newsletter Subscribers in the admin panel.

However, these accounts which signed up newsletter during registration are put into the Newsletter Subscribers list without names and Type column incorrectly shown as Guest.

Strangely, if the user updates his account information such his name, the user's Type will be updated to Customer on the Newsletter Subscribers page.

Why doesn't Magento populate the customer's name which was entered during registration in the Newsletter Subscribers page? Since the customer is already signing up an account, why is the Type categorised as Guest but not Customer?

Is this a bug in Magento2? How can I fix it?


texts: Magento 2: memcached error "SessionHandler::read(): Unable to clear session lock record in"

texts:
I enable Memcahed cache and change app/etc/env.php to

array (
    'save' => 'memcached',
      'save_path' => '127.0.0.1:11211')

And now i get this error

SessionHandler::read(): Unable to clear session lock record in

I create session folder under var directory
and i set permission 777 to all folders
bud error does not fixed


texts: Newsletter popup only showing clossing button

texts:
In my theme settings having enable newsletter pop-up option, i enable it. But showing light grey-out colour and clossing button only, not getting newsletter form.

Thanks.


texts: M2 - Not creating nl_NL.csv in static files

texts:
I'm running Magento 2 in developer mode, but I need to translate the error message:

Provided Zip/Postal Code seems to be invalid. Example: 1234 AB/1234AB. If you believe it is the right one you can ignore this notice.

So I created the string in app/design/frontend/Mgs/claue/i18n/nl_NL.csv
I run the following commands:

bin/magento setup:upgrade

bin/magento setup:static-content:deploy -f nl_NL

bin/magento cache:flush

bin/magento cache:clean

After that I wait till the static files will be created and look into:
pub/static/frontend/Mgs/claue/nl_NL/i18n
And there is only 1 file: en_US.csv and not nl_NL.csv
How is that possible? Is there another way to translate that string?
UPDATE:
It's registered in vendor/magento/language-nl_nl/registration.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::LANGUAGE,'magento_nl_nl', __DIR__);

Magento version: 2.3.0


texts: Magento 2: Search Terms hyperlink does not show results

texts:
I am trying to view popular search terms but but it does not show anything

I have done couple of things.

1). Cleared cached

2). Have seen reports -> search terms

3). Looked at stores-> catalog -> catalog -> search engine optimization -> popular search terms -> enable.

Anyone Please guide me regarding this.

Thanks in Advance.


texts: Magento 1.X Override Core Model with subcategory

texts:
I read a lot of answers of how to override models like:

app/code/core/Mage/Checkout/Model/Cart.php

And i don't know if i did something wrong but if i tried the same with:

app/code/core/Mage/Sales/Model/Config/Ordered.php

It doesn't works. I have:

config.xml
    <global>
        <models>
            <sales>
                <model>
                    <config>
                        <rewrite>
                            <ordered>Name_Example_Sales_Model_Config_Ordered</ordered>
                        </rewrite>
                    </config>
                </model>
            </sales>
        </models>
    </global>

and in app/code/local/Name/Example/Model/Config/Ordered.php:

class Name_Example_Sales_Config extends Mage_Sales_Model_Config_Ordered
{
    protected function _getSortedCollectorCodes()
    {

I don't know what the correct structure of the path or the xml.


texts: USPS shows free shipping to Canada I do not offer this

texts:
I have had this issue for awhile and need to fix it ASAP.  I am from the USA and do not offer free International shipping.  I only offer free UPS Ground in the United states if order is over 49.99.  Customers who order from Canada are only offered USPS 0.00  not sure what is going on here I have changed nothing.   Here is my shopping cart price rules.

If ALL  of these conditions are TRUE :
Subtotal  equals or greater than  49.00
Shipping Country  is  United States
Shipping State/Province  is not  Alaska
Shipping State/Province  is not  Hawaii
Shipping State/Province  is not  Virgin Islands
Shipping State/Province  is not  Palau
Shipping State/Province  is not  Guam
If ANY  of these conditions are TRUE :
If ALL  of these conditions are TRUE :
Shipping Postcode  greater than  00900
Shipping Postcode  less than  96200
If ALL  of these conditions are TRUE :
Shipping Postcode  greater than  97000
Shipping Postcode  less than  99500
Shipping Country  is not  Canada
Shipping State/Province  is not  Ontario
Shipping State/Province  is not  British Columbia
Shipping State/Province  is not  Alberta
Shipping State/Province  is not  Manitoba
Shipping State/Province  is not  New Brunswick
Shipping State/Province  is not  Newfoundland and Labrador
Shipping State/Province  is not  Yukon Territory
Shipping State/Province  is not  Saskatchewan
Shipping State/Province  is not  Quebec
Shipping State/Province  is not  Prince Edward Island
Shipping State/Province  is not  Nunavut
Shipping State/Province  is not  Nova Scotia
Shipping State/Province  is not  Northwest Territories
Shipping State/Province  is not  ...
Shipping Country  is  ...


texts: Corrupted name of installation script-file in custom extension

texts:
I've created custom extension(Magento 1.7.0.2, Ubuntu 14.04), made a package and trying to install it. Everything seems to be ok.
But instead of file sql/mycompany_thenameofdevelopedmodule/install-3.1.5.6.php it creates a directory with the same name (install-3.1.5.6.php).

After some investigation I found that if summary path string length is too long, old Magento(1.7.0.2) unpack script will corrupt a file name. For ex.(in my case),

/var/www/mystore/public_html/app/code/community/MyCompany/Thenameofdevelopedmodule/sql/mycompany_thenameofdevelopedmodule/install-3.1.5.6.php

EDIT: Added error to post

2015-07-09T11:43:22+00:00 ERR (3): Warning: include(/var/www/mystore/public_html/app/code/community/MyCompany/Thenameofdevelopedmodule/sql/mycompany_thenameofdevelopedmodule/install-1.2.1.php): failed to open stream: No such file or directory in /var/www/mystore/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php on line 624 Rising of warning error is logical - file became a directory, so it doesn't exist anymore

will cause the problem I've described above…

Has anyone faced with this problem and what is the solution except of making the path shorter?


texts:
I am having a complex SQL query to make a custom report & showing same to custom report grid but somehow not able to convert the query into Magento's equivalent Collection.

SELECT SUM(order_items.qty_ordered) AS `ordered_qty`, `order_items`.`name` AS `order_items_name`, `order_items`.`product_id` AS `entity_id`, `e`.`entity_type_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`sku`, `order`.`created_at`, `order`.`updated_at`, `ps`.`qty` AS `current_stock`, (ps.qty - SUM(order_items.qty_ordered)) AS `difrnc`, `c`.`value` as `costing`, ((ps.qty - SUM(order_items.qty_ordered)) * `c`.`value`) AS `totcsttostock`
         FROM `sales_flat_order_item` AS `order_items`
         INNER JOIN `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id AND `order`.state <> 'canceled'
         LEFT JOIN `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND e.entity_id = order_items.product_id AND e.entity_type_id = 4
         LEFT JOIN `cataloginventory_stock_item` AS `ps` ON ps.product_id=order_items.product_id
         LEFT JOIN `catalog_product_entity_decimal` AS `c` ON c.entity_id=order_items.product_id and c.attribute_id=79
         WHERE `order`.`created_at` BETWEEN '2017-09-22 00:00:00' AND '2017-09-22 23:59:59' and (parent_item_id IS NULL)
         GROUP BY `order_items`.`product_id` HAVING (SUM(order_items.qty_ordered) > 0) ORDER BY `ordered_qty` desc

I have converted this much(which might have mistakes), but needed help/suggestion ahead

function __construct() {
    parent::__construct();
    $this->setResourceModel('sales/order_item');
    $this->_init('sales/order_item','item_id'); }
public function setDateRange($from, $to) {
$this->_reset();
        $this->getSelect()
             ->joinInner(array('i' => $this->getTable('sales/order_item')),'i.order_id = main_table.entity_id','SUM(i.qty_ordered) AS ordered_qty')
->joinLeft(array('ps' => $this->getTable('cataloginventory/stock_item')), 'ps.product_id=i.product_id', 'ps.qty as current_stock, (ps.qty - SUM(i.qty_ordered)) AS difrnc')
->joinLeft(array('e' => $this->getTable('catalog/product')), '(e.type_id NOT IN ("grouped", "configurable", "bundle")) AND e.entity_id = i.product_id AND e.entity_type_id = 4')
->joinLeft(array('c' => $this->getTableName('catalog/product','decimal')), 'c.entity_id=i.product_id and c.attribute_id=79', 'c.value as costing, ((ps.qty - SUM(i.qty_ordered)) * c.value) AS totcsttostock')
             ->where('i.parent_item_id is null')
             ->where("i.created_at BETWEEN '".$from."' AND '".$to."'")
             ->where('main_table.state = \'complete\'')
             ->columns(array('ordered_qty' => 'count(distinct main_table.entity_id)'));
             echo $this->getSelect();
        return $this;
    }

Please, can someone help or suggest anything?


texts: Magento URL key including / redirect to 404

texts:
I would like to generate url keys with '/' of products. I have override the \Enterprise_Catalog_Model_Product_Attribute_Backend_Urlkey::beforeSave method and generated url key as per requirement.

My before save method is :

public function beforeSave($object)
    {
        $attributeName = $this->getAttribute()->getName();

        if ($object->getIsDuplicate()) {
            $object = $this->_generateNextUrlKeySuffix($object);
        }
        $brandLong = $object->getData('brand_long');
        $collection = $object->getData('collection');
        $urlKey = $object->formatUrlKey($brandLong).'/'.$object->formatUrlKey($collection).'/'.$object->formatUrlKey($object->getData('sku'));
        if (empty($urlKey)) {
            $object->setData($attributeName, $object->formatUrlKey($object->getName()));
            $object = $this->_generateNextUrlKeySuffix($object);
        } elseif (!empty($urlKey) && !$object->getIsDuplicate()) {
            $object->setData($attributeName, $urlKey);
        }

        $this->_validateEntityUrl($object);
        return $this;
    }

But generated url keys redirecting to 404.Url key is as below

attribute1-value/attribute2/sku

It redirecting to 404


texts: how to display a notification or message when you added an item to cart

texts:
I want to display a notification or message to the user; when he adds an item to the cart, which is limited to '1' item max. a message like : 'You can add 1 item maximum' . I did an observer to block the add but it shows me the error message in the log default magento. it's not pretty,I want to display it in the same page

My observer:

// Event: catalog_product_type_prepare_full_options

public function limit_(Varient_Event_Observer $observer) {

    $quote = Mage::getSingleton('checkout/session')->getQuote();
    if($quote->getItemsCount()>=1){
        Mage::throwException('You can add 1 item maximum.');
    }

}


texts: Check if product exists in more than one category

texts:
I have the following code in view.phtml that checks if a product is in a specific category (2495), and if it is, outputs some text.

EXISTING CODE

<?php if (Mage::registry('current_category') && Mage::registry('current_category')->getId() == 2495) { ?>
CONTENT GOES HERE...
<?php } ?>

How do I go about checking if the product exists in more than one category (e.g. 2495, 2496 & 2497)?


texts: How to show discount percentage over the image of my products?

texts:
What I am trying to achieve is this, I have configurable products I want to display the percentage of the discount as a label on the image maybe in the top right corner. I've managed to display it by using this code:

       <span>
         <?php
         $item = $block->getSaleableItem();
         $_savePercent = 100 - round(((float)$priceModel->getAmount()->getValue() / (float)$finalPriceModel->getAmount()->getValue()) * 100);
         echo '<b style="color:#008000">'.$_savePercent . '% off </b>';
        ?>
      </span>

This edit is placed in my final_price.phtml file. However with this I am displaying the % Discount in my product page as well. Because I will have different stylings for both the pages I want to display it seperatly once in the catalog and once on the product page. Is there a way to do it? I do not want to use extensions.


texts: How to add the special price for every product thrugh excel sheet in magento 2?

texts: I am using Magento 2.2.7 how to add the special price. and it will be showing the mrp and special price for every product how to do that?


texts: Show block and template from other extension

texts:
I'm having some troubles in showing one simple block from other model.

I have these extensions:

Extension 1: /app/design/frontend/base/default/template/[module]_1/

Extension 2: /app/design/frontend/base/default/template/[module]_2/

I want to show one block from [module]_1 in [module]_2.

I already put some code in [module]_2 .xml file:

<block type="[module]_1/onepage_pickmeshops_dropdown" name="[module]_1.pickmeshops.dropdown" as="pickme" template="[module]_1/checkout/onepage/shipping_method/pickmeshopsdropdown.phtml"/>

And added this code where i want to display the info:

<?php echo $this->getChildHtml('pickme') ?>

But after all i can't see what i want to see..

Update:

Here is my module 2 .xml:

<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="onepagecheckout/onepage/review.phtml">
                    <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="onepagecheckout/onepage/coupon.phtml"/>
                    <block type="onepagecheckout/agreements" name="checkout.onepage.agreements" as="agreements" template="onepagecheckout/onepage/agreements.phtml"/>
                    <block type="core/template" name="chronopost.pickmeshops.dropdown" as="pickme" template="chronopost_shipping/checkout/onepage/shipping_method/pickmeshopsdropdown.phtml"/>
                    <block type="checkout/onepage_review_info" name="info" template="onepagecheckout/onepage/review/info.phtml">
                        <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>onepagecheckout/onepage/review/item.phtml</template></action>
                        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>onepagecheckout/onepage/review/item.phtml</template></action>
                        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>onepagecheckout/onepage/review/item.phtml</template></action>
                        <block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onepagecheckout/onepage/review/totals.phtml"/>
                        <block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before"/>
                    </block>
                </block>

And a little more info:

        <?php echo $this->getChildHtml('agreements') ?>
    <?php echo $this->getChildHtml('pickme') ?>
            <?php if (Mage::helper('onepagecheckout')->isSubscribeNewAllowed()) : ?>
        <p class="newsletter">
            <input type="checkbox" id="newsletter-signup" name="newsletter" value="1" title="<?php echo Mage::helper('newsletter')->__('Sign up for our newsletter') ?>" class="checkbox" />
            <label for="newsletter-signup">
                <?php echo Mage::helper('newsletter')->__('Sign up for our newsletter') ?>
            </label>
        </p>
    <?php endif; ?>


texts: Magento 2: add INLINE script tag into header through XML

texts:
I'm trying to add an inline script tag into the header, by creating a new text block in default_head_blocks.xml, but my setText method doesn't seem to be applying it correctly.

Here's my setup:

THEME_DIR/Magento_Theme/layout/default_head_blocks.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <block type="Magento\Framework\View\Element\Text" name="my_script">
        <action method="setText">
            <argument translate="true" name="text" xsi:type="string">
                <![CDATA[<script>console.log("I'm loaded!");</script>]]>
            </argument>
        </action>
    </block>
</head>
</page>

What is the correct way to insert inline script tags into the header?


texts: Magento2 apache rewrites not working on local

texts:
I have a new local version of Magento2 and it all works and installs correctly.

The only thing that isn't working is the URL rewrites. I have an htaccess file in the root of the site.

Apache 2.4 - attached is my vhost file. (Maybe I need something else here?)

Mac El Capitan

<VirtualHost *:80>
        DocumentRoot /Users/brent/Sites/magento2/
        ServerName magento2.super-awesome-test.com
        <Directory  /Users/brent/Sites/magento2>
        Require all granted
        Options Includes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        </Directory>
        ErrorLog /Users/brent/Sites/magento2/logs/mage2-error.log
        CustomLog /Users/brent/Sites/magento2/logs/mage2-access.log common
</VirtualHost>


texts: How can I customize the order confirmation based on payment method?

texts:
I'd like to include a QR code in the order confirmation for all orders with a specific payment method chosen. I'm not too sure where to start.

Currently the payment details section of the order confirmation contains exactly what you see during checkout (banking details etc. for an EFT-style payment).

Would appreciate any pointers.


texts: auto populate "configurable_variations" column for csv import into magento 2.3.4

texts:
I am using openoffice calc to generate import files for magento 2 csv import based on previously generated files with a different structure.
Has anyone found a formula to auto-populate the "configurable_variations" column for csv import into magento 2? I would set up the file where the simple associated products would either precede or follow the configurable. The aggregate data from the simple cells will be placed in the "configurable_variations" column then stop aggregating when a row shows type as "configurable"
Below is a simple version of how it should look.
sku  size  type  configurable_variations
bc5  L     simp
abc        conf  bc5-L
bc1  S     simp
bc2  M     simp
efg        conf  bc1-S|bc2-M
I do understand how to do the concatenated part. The part I can't figure out is how to get the formula to stop concatenating when it reaches the topmost "type" column "conf" above the "'sim" s, then restart the aggregate/concatenations automatically for the next conf type.
If I input the cells manually the formula would be :
=IF(C5="conf";CONCATENATE(A4;"-";B4;"|";A3;"-";B3))
Ideally, I would like it to auto-generate the a4, b4, a3 & b3 possibly using a helper column that has some type of "if-then" formula
If you have any other suggestion on how to do this it would be much appreciated
Thank you very much for your help


texts: Magento site not showing products in admin?

texts:
Magento site not showing products in admin. BUT after an import they show in the categories in the back end of the website.

The products dont show in the front end. All I did was upload a newer csv with system > import/export > dataflow - profiles.

Any ideas?


texts:
How to save customer attribute value in custom script in Magento 2.

The prerequisite is to add first your new attribute programatically.

To do add a customer attribute please review these:

Magento2 create a customer custom attribute
https://github.com/magento/magento2/issues/1238#issuecomment-105034397


texts: Advice on Optimizing Site Speed, where to start?

texts:
I've been asked to try and find a solution for the slow load time of our Magento site. I ran a Yslow test and the biggest offenders seem to be

Make fewer HTTP requests
Use a CDN
Add Expires Headers
Put Javascript at the Bottom
Minify jS and CSS
Configure ET Tags
Reduce DNS lookups
Avoid AlphaImageLoader Filter

As an E-Commerce manager I am looking for some advice as to what I can do from my role within the Magento admin, webmaster tools, etc. and what I can instruct a developer to do get our site up to compliance and noticeably speedier.

I've also been looking at a plugin called GTMetrix that seems to do a lot of this for you within the admin (combine CSS sheets, optimize images, etc), does anyone have any experience with this? I usually try to avoid too many extensions that reach so deep into essential functions but seems like might be a solution. http://gtmetrix.com/magento-optimization-guide.html

Your advice would be much appreciated, as I am having a hard time knowing where to start to have the best impact.

Thanks in advance.


texts:
I am using Magento 2.2.6 with a theme. www.rbhomoeoshop.com The store is using rule to offer x amount of discount on each and every product. There is no condition for discount.

after every 2 or 3 days the discount rule is removed by it self. I have to run a reindex command manually, using ssh.

One of my developer friend gave me a php file with reindex command and set a cron to run that php file twice in a day.

I am getting mail on execution of the cron file but the re-index command is not working. There is no error.

Requesting all to suggest a solution.


texts: Magento 2: Add new function to an extension

texts:
I have installed an extension and need to add a new function to it without editing the core extension files.

I need to add a function in this file/class:
Vendor/vendor_name/module_name/block/Post/View.php

How is this done?


texts: MAGENTO 2 Email footer.html links not working

texts:
In my module http://magento2/app/design/frontend/company/module/Magento_Email/email/footer.html

there is this line:

{{trans "About Uss"}}

{{trans "Customer Servicee"}}

However when I get the Email the link doesn't work.

When I copy the link this is what it looks like:

  x-webdoc://EF91B121-13BE-4DCE-814F-ED522ADF4BB5/about-us

  x-webdoc://EF91B121-13BE-4DCE-814F-ED522ADF4BB5/contact

Can you help.


texts: Magento 2.3.4: Why doesn't Magento admin configuration take any effect on the `fax` field?

texts: The option for fax under Store->Configuration->Customer->Customer Configuration->Name and Address options was set to NO right from the beginning of the installation of Magento 2. It is strange to see the fax field on the storefront where it shouldn't be. Is this a bug or am I supposed to have done something? Also, if I remove the fax field via default.xml then the Place Order button becomes inactive leaving nothing in the log files for us to debug. Can anyone say if there is a fix? Does it have anything to do with the event handlers that are being made use of in our Magento site?


texts: Issue with creating additional contact forms - recaptcha

texts:
I'm trying to create an additional contact form and am running into an issue - initially I modified the default contacts form but ran into issues so tried just using the default contact form on a CMS page, using the following code:

{{block type='core/template' template='contacts/form.phtml'}}

but whenever I try to submit the form it produces the following error

Fatal error: Call to a member function setFormAction() on a non-object in /home/urider/web/app/code/community/Fontis/Recaptcha/controllers/ContactsController.php on line 32

line 31,32 is as follows:

$this->loadLayout();
$this->getLayout()->getBlock('contactForm')->setFormAction( Mage::getUrl('*/*/post') );

From what I've seen online it may be something to do with the layout not being loaded but I'm really not sure, any thoughts?


texts: How can I change my Magento2 Checkout Page CSS?

texts:
When I tried to change checkout Page CSS,It does not get applied.I used to write my CSS on _extend.less file in my theme folder.This applies for Homepage, Catalog Page, Product Detail Page, Cart Page.But for Checkout Page even after deploying, It does not get applied.Please help me.Below is my code.

.opc-wrapper .step-title

{

    color: #cc0000;

    text-transform: uppercase;

    font-size: 13px;

    font-weight: 600;

}

.opc-wrapper .form-login .fieldset .field .label

{

    color:#646464;

    font-weight:500;

    font-size:13.5px;

}

Thanks in advance.


texts:
exist any way in Magento to add Upsell Products at the very bottom of the success.phtml page? If this is important I use Ultimo Theme.

Thank you

Edit:

I found a code, that is seem to be ok for me but in the frontend I have "Record not foundRecord not found "

this is the code, maybe someone can understand more than me:

    $orderIcrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();

       $order = Mage::getModel('sales/order')->loadByIncrementId($orderIcrementId);

       $orderItems = $order->getAllItems();

foreach($orderItems as $orderItem):

   // Get product object.
   $object = Mage::getModel('catalog/product')->load($orderItem->getProductId());

   //Get product detail using product id  (Suppose you have product id is : $product_id)
   $_product = $object->load($product_id);

   // Fetch list of upsell product using query.
   $upsell_product = $_product->getUpSellProductCollection()->addAttributeToSort('position', Varien_Db_Select::SQL_ASC)->addStoreFilter();

   //check if record is empty or not
   $count = count($upsell_product);
   if(empty($count)) :
       //if empty
       echo "Record not found";
   else:
     //if result is not empty then get  upsell product detail using foreach loop
      foreach($upsell_product as $_upsell):

         //get detail of single upsell prdocut using upsell product id
         $upsp = $object->load($_upsell->getId());

         echo "Product Name : ". $upsp->getName();
         echo "Poduct url : ". $upsp->getProductUrl();
         echo "Product regular price : ". $upsp->getPrice();

       endforeach;
   endif;

       endforeach;


texts: magento console errors when script is written in header

texts:
In header we have code like this in separate scripts

var $ck = jQuery.noConflict();
var $abc = jQuery.noConflict();
var $frr = jQuery.noConflict();

The requirement is working but I have observed in the console

ReferenceError: jQuery is not defined
ReferenceError: decorateList is not defined
ReferenceError: Varien is not defined

Please find the below image

can anyone help me on this issue.

thanks


texts: Cant get Admin Token using cUrl 403 error

texts:
I've managed to get the API Token using Postman however, when I try to get the admin token through a cUrl request it returns a 403 error.
Postman Post Request:

https://localhost/index.php/rest/V1/integration/admin/token?username=admin&password=password

Magento 2 cUrl Request:
$tokenUrl = "https://localhost/index.php/rest/all/V1/integration/admin/token";
$data = array("username" => "admin", "password" => "password");
$dataString = json_encode($data);

$ch = curl_init($tokenUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($dataString)
));
$token = curl_exec($ch);
return $token;

Is this due to missing headers perhaps?
Update:
I've confirmed within Swagger the correct url should be https://localhost/rest/all/V1/integration/admin/token so I've amended the URL and it still returns a 403. However, adding my admin credentials into the swagger request I can get the API key no problem.
Could it be possible that there is a server permission not allowing rest requests to be made internally on the server?


texts:
Not sure how to remove free shipping option from sort by options.

There is currently no free shipping products but it picks up all products, hence misleading.

Thanks


texts: Error message is showing while adding or editing a product from dashboard

texts:
I have installed a module from github Mageplaza_Seo. latter when i disabled it and when i went to dashboard and adding/editing products iam getting below error in /magento2/var/report log file

why this error occurring when my module is disabled too.and i have deleted folder from ftp

Fatal error: Class 'Mageplaza\Seo\Model\Source\Robots' not found in /home/shelltag/public_html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93

any suggestions?


texts: Magento - change email in forgotpassword before check it

texts:
In forgot password form, i need to get the email and change it before magento check it.

Why?, beacuse i need to change a customer personal number like 9834592845 to their email store in database (bla@ble.bli)

i work with the event:
controller_action_predispatch_customer_account_forgotpassword

but i can't get the email, i tried

$username = $observer->getRequest()->getPost('email');
$username = $observer->getRequest()->getPost();
$postData = Mage::app()->getRequest()->getPost();
$username = $observer->getData('email');
$username = $observer->getEmail();
$username = $_POST;
$username = $_POST['login']['username'];
$username = $_POST['login']['email'];
Mage::log($username);

and more, but nothing.

What i'm doing wrong.

I appreciate any help.


texts: Magento ajax upload in file type over product custom options

texts: I want build ajax upload in product custom options in the file type.


texts: Magento 2 : On paypal orders billing information displaying incorrect format in admin order

texts:
My recent upgrade is 2.3.2 as Magento moves we are upgrading one by one, but we are having an issue which is on Paypal orders we are getting variable prefixes in billing address as an email template format. Is there any fix relates to its.

  I tried few solutions who got fixed earlier but no luck, In database also I checked
  it is perfect. But why it is not fixed yet. We didn't touch anything
  in code.

Please help me to get the best solution for this.


texts: Magento2 : Page_layout Container And Widget Configuration

texts:
I'm new on Magento 2, I have created a custom theme and a custom page_layout in /app/design/frontend/[Vendor]/[ThemeDir]/Magento_Theme/page_layout/homepage.xml

<referenceContainer name="page.wrapper">
    <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
    <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>

    <container name="home.news" as="home_news" label="Home News" htmlTag="div" htmlClass="home-news" before="main.content" />

    <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
</referenceContainer>

( I created the layout.xml too )

My custom layout is referenced in the administration so I selected it for the page "Home page" under "Design"

Why the container I have created "home.news" in this page_layout isn't referenced in the administration "Content > Widget > Layout Update" ?

My idea is to reference container on the home page in order to be able to add widget into this container from the adminsitration ...

Any help are welcome ...

Thank,


texts: In blocks or cms pages I'm trying to add an image (Magento 2). But after selecting an image and choosing insert (from insert image popup) image URL of the image is wysiwyg/image.jpg and preview is missing. I think it should be followed by pub/media. How fix this, it is a bug?


texts: Doubled title suffix in admin (backend) pages - Magento 1.9

texts:
A client needs to add Title Suffix to show in all Magento administration pages. So I added it in System -> Configuration -> General -> Design -> Title Suffix and when I enter some text, this text shows twice.
For example, if I enter | My page, it shows:

Configuration / System / Magento Admin | My page | My page.

Is this Magento bug?


texts: Sales>Orders grid columns "pending Sync"

texts:
I have the Magento ShipEasy and PickPack extension installed.

Under Sales>Orders a few columns specifically "Qty" and a custom attribute "Location" are not showing data from orders but rather appearing as "pending sync" yet all other information on other columns appears.

Previously this error never appeared and all data would show up. It stopped working last week on thursday.

Anyone have any ideas on how to fix this issue?

Thanks,

Amit


texts: Get customer details using custom attribute

texts:
We are using a custom attribute on customer that references an ID on an external system. We want to get customer's details on a custom page by loading the customer by this custom attribute.

I tried using simple code as below

$om = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Customer\Model\CustomerFactory')->create();
$customer = $om->loadByAttribute('ext_id','1234');

But this doesnt seem to work. Can someone please help me.


texts: how to get url in product page with product name?

texts:
https://example.com/magentoce1.8/index.php/furniture.html ,like the above formated

i tried mage::getUrl() but not getting desired output


texts: Magento Fitler based on Custom Attribute

texts:
I SAW LOT OF POSTS ON Stackoverflow & here also , I DIDN'T get SINGLE proper answer.

Hi dudes,
I have Filter option when i goto other Category->Product listing page .

I want to make it like Sort Dropdown of magento by default.

I have custom attr. as Carat for golden shop . I set its value from backend ,like 14,15 etc.

I m fetching it properly in drop down.

What should be done if i want to filter products by Carat ?

Till now my code to fetch Custom attr. & show in DDList.

    <?php
        $name='carat_dropdown';
        $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($name)->getFirstItem();
        $attributeId = $attributeInfo->getAttributeId();
        $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
        $attributeOptions = $attribute ->getSource()->getAllOptions(false);
    ?>

        <?php echo $this->__('Filter By') ?>
        <select name="filterByCaret" >
                <option value="" >Select</option>
            <?php
            foreach($attributeOptions as $single){
            ?>
                <option value="<?php echo $single['value']?>" >
                    <?php echo $single['label']?>
                </option>
            <?php
            }
            ?>
        </select>

DDList = Drop Down List.

Even in simple way

. Hi see, i have custom field in backend for jewellery shop Caret Value  .So in drop down i will have all values i enter from backend for Carat Value like 13,14 etc. So in front end i want to show DDList ,and if i select 14 , products with Carat value 14 will be filtered &shown
Thanks for help.


texts: Whenever I use the change additional information option, it does not change - Magento 1.9.1

texts:
In Magento 1.9.1 whenever I use the change product option from the dropdown the product price and availability it will change but the additional information is not changed.

I want it to be so that if the user changes the drop-down then the additional information of that particular product also changes.

Can anyone tell me why it will not change and how to fix this issue? Any extension is available for that?


texts: how to get mysql query of collection for fetching report details - magento 2

texts:
Agenda:  convert mysql query result to json then I can visualize by using fluentd + elasticsearch + kibana.

I have successfully visualize sample mysql query.

I am looking mysql query for getting below reports.

Last Orders
Last Search Terms
Top Search Terms
Best Seller
Most Viewed Products
Customer Count
Visitor Count Based on date
Admin -> Report -> I need all reports from here

is there any shortcut to find mysql query of above all? or is there any cheet sheet available?


texts: How do I add Javascript handler to product options tab in admin?

texts:
I need a hook to execute when "product options" tab gets loaded (I want add cursor keys movement across the grid up and down).

window, 'load' doesn't help because the tab gets loaded with Ajax. How do I add a better hook?


texts: Uncaught SoapFault exception: [Client] looks like we got no XML document php

texts:
I'm trying to make a SOAP web service work.
I have a XAMPP server installed and I use Visual Studio Code for coding. I've created a web service in a file called "servidorWs.php'. Its content is the following:

function sumar($n1, $n2){
    return $n1+$n2;
}
function restar($n1, $n2){
     return $n1+$n2;
}

$uri ="localhost/34curso";
$servidor = new SoapServer(null, array('uri'=>$uri));

$servidor->addFunction("sumar");
$servidor->addFunction("restar");
$servidor->handle();

echo "Servidor de servicios web SOAP funcionando.";

And also I've created a web service consumer in the file "consumidorWs.php" with the following code:

  Blockquote

//Al no especificar el wsdl del servicio web, debemos detallar el url donde
 vamos a consumir el servicio

 $url="http://localhost/34curso/servidorWs.php";
   $uri="http://localhost/34curso/";

   //Creamos el cliente con el segundo parámetro. El primero null
   $cliente = new SoapClient(null, array('location'=>$url, 'uri'=>$uri));

   $numero = $cliente->sumar(5,4);
   echo "valor de la suma ".$numero."<br/>";

   $numero = $cliente->restar(5,4);
   echo "valor de la resta ".$resta;

  Blockquote

I call the webserver in Google Chrome and apparently it works.
But when I execute the client I get the following message:

  Fatal error: Uncaught SoapFault exception: [Client] looks like we got
  no XML document in ...consumidorWs.php:9 Stack trace: #0 ...
  consumidorWs.php(9): SoapClient->__call('sumar', Array) #1 {main}
  thrown in ...consumidorWs.php on line 9.

Can anybody help me?
Is it necessary to do anything to make the server works? I tried executing in the Terminal with no difference.

Thank you.

Best wishes.


texts: where can i change the url in cart that directs to checkout onepage?

texts:
Magento 1.9.1.0

In header i have the shopping cart displaying:

an icon (which links to domain.nl/checkout/cart)
the link saying: x item(s) which also links to that url

but, when hovering over these 2 it shows a small dropdown with the cart contents and in it is a button "checkout"

that links to domain.nl/checkout/onepage ...

What file would i need to edit to change that url also to domain.nl/checkout/cart and it would be great if anyone could also tell me which line to edit

Because many people seem to click checkout, therefore missing the opportunity to check cart contents and entering discount code.

site can be found here


texts: Magento product images not loading in frontend after product import

texts:
I have recently imported products alongwith product images from Magento 2.3 import tool. After import, these images are showing in Admin panel but not in frontend.
When I see the path in frontend, I find it like this:
https://mywebsite/pub/media/catalog/product/cache/0881516b480c504c1d3d479a585547eb/agst02-natural-study-table-home-office-desk-solid-wood-tulsa-6.png
I tried to figure out the same path but not present, the actual images are present on the path /pub/media/catalog/product directory which I feel is perfect for magento to work but actually no luck.
What I did as remedy is below:
sudo php bin/magento setup:di:compile
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 pub/media
But none of the solutions is working for me.


texts: Can't access admin after refreshing cache

texts:
Was trying to create an admin module and got the helper_class not found error

Fatal error: Class 'my_module_Helper_Data' not found in /home/myweb/public_html/app/Mage.php on line 547

But now I can't access admin panel after deleting the files I uploaded including the app/etc/modules/my_module.xml.

Tried emptying var/cache but still no luck :/!


texts: I am using Magento 2.2.5. Order confirmation emails, Invoice emails and any of the custom emails are not receiving to the particular domain based email. Client has the server on go daddy VPS. Mails are receiving for the gmail and only domain based emails has this issue.


texts:
I have enabled the stock availability attribute in the layer navigation and it is showing the "In Stock" and "Out of Stock" option correctly but when we filter the in stock product it is not working.
Is there any know the solution for the same??


texts: Unable to get order details using magento 2 rest api

texts:
I have created an order in magento 2. And magento gave me this message

  "Your order number is: 000000235. We'll email you an order
  confirmation with details and tracking info."

Screen shot is also attached,

Then I tried to fetch the order details using rest api endpoint rest/V1/orders/235 in salesOrderRepositoryV1 on http://devdocs.magento.com/swagger/#/

My request as shown in screenshot,

but everytime i get this,

{
"message": "Requested entity doesn't exist"
}

Just for the reference screen shot of admin panel->sales->orders is also attached that i am fetching the details against the valid order id.

I investigated this isssue, here are some of my findings,

This is not happening with all the orders.
Its due to the difference between entity_id and increment_id in sales_order table.
For most of the old orders(those i created earlier) everything is working fine but for most recent orders this issue is occuring(for which i have different entity_id and increment_id(magento gives us this id at success page)
I need to pass in increment_id in rest/V1/orders/{id} but this endpoint point to entity_id in the sales_order table

Why i have difference in my entity_id and increment_id? In sales_order table i have same entity_id and increment_id for the first 165 orders(i.e entity_id = increment_id) then form entity_id 166 my increment_id became 179. Why this difference came in suddenly.

Can anyone please explain?


texts: magento 2 custom module is not listing in admin panel

texts:
after php bin/magento setup:upgrade module is not listed. where is my mistake?

File location are

app/code/Test/composer.json

{
    "name": "test/banners",
    "description": "Test Banner For test",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Test\\Banners\\": ""
        }
    }
}

app/code/Test/registration.php

  <?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Test_Banners',
    __DIR__
);

app/code/Test/Banners/etc/module.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Test_Banners" setup_version="2.0.0">

    </module>
</config>


texts:
I have an install of Magento 1.8.1.0 and for some reason under Configuration -> Sales -> Payment Methods I'm not seeing "CyberSource (SOAP Toolkit)" as an option.  Authorize.Net is there along with PayPal and others, but not CyberSource.  It's the first time I'm working with CyberSource.
Compilation is disabled:
php -f shell/compiler.php -- state
Compiler Status:          Disabled
Compilation State:        Not Compiled
Collected Files Count:    0
Compiled Scopes Count:    0

PHP SOAP is installed and available. php -i | grep configure shows:
--enable-soap
--with-openssl
--with-libxml-dir

I've seen other screenshots of the Payment Methods screen showing the CyberSource entry, but not on mine.  Is there something else I have to install?
Any help would be greatly appreciated.


texts:
<?php
include 'app/Mage.php';
Mage::app();
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$writeConnection = $resource->getConnection('core_write');

 $productCollection = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToFilter('name', array('like' => '%hp%'))
->addAttributeToSelect('*');

foreach ($productCollection as $product) {
//echo $product->getSku();
echo "

".$product->getName()."

".$product->getDescription()."

";
echo 'getUrlPath().'"> getImage().'">';
    }
?>

When I write this code it gives me this output. See the snapshot.. How should I get the image path?


texts: How to change default email id "hello@example.com" (Magento 1.9)

texts:
How to change "hello@example.com" (Magento 1.9)

I have installed the extension SMTP pro.

After running "self test" of the extension, it displays following error

         SMTP Pro Self Test Results :
        Sending test email to your contact
from address: hello@example.com
from: [My_Email_id_Here] Unable to send test email

Now how do I change this default email id "helloworld@example.com" ?


texts: What are the theming limitations of Magento Go?

texts:
I'm familiar with Magento CE/EE, but I'm looking at Magento Go for a new project.

The official website doesn't include a lot of details about what is/isn't possible to achieve design wise.

Is there a set number of themes to choose from?
How much freedom do you have for changing your theme?
Is is possible to have a completely custom theme, if you can't find a suitable existing one?


texts: Disabled product redirect from 404 to CMS

texts:
My client doesn't want customers landing on a 404 due to a product being disabled. My first thought was write an observer that would fire as soon as someone 'viewed' a product, however that solution didn't pan out for myself or another dev (who is much more experienced). I decided to go the route of rewriting the ProductController, specifically the viewAction within it. My current hope, was that when a normal 'enabled' product was viewed that things would run as normal, and when a disabled product was viewed, that it would avoid the 404 and direct you to a custom CMS page.

Below is the viewAction() function. Currently, if you view an enabled product it enters the viewAction function and hits the exit;(leaving you with a blank page), however with a disabled product, it never enters this function and leaves you with a 404. Which leaves me with 2 possibilities;

I need to find where, if a product is 'disabled' it directs you to a 404 (I've spent a few hours on it to no avail).
It IS supposed to come through this function, but isn't because something else is wrong/affecting it locally

public function viewAction() {
    exit;

    $categoryId = (int) $this->getRequest()->getParam('category', false);
    $productId  = (int) $this->getRequest()->getParam('id');
    $specifyOptions = $this->getRequest()->getParam('options');

    // Prepare helper and params
    $viewHelper = Mage::helper('catalog/product_view');

    $params = new Varien_Object();
    $params->setCategoryId($categoryId);
    $params->setSpecifyOptions($specifyOptions);

    try {
        $viewHelper->prepareAndRender($productId, $this, $params);
    } catch (Exception $e) {
        if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) {
            if (isset($_GET['store'])  && !$this->getResponse()->isRedirect()) {
                $this->_redirect('');
            } elseif (!$this->getResponse()->isRedirect()) {
                $this->_forward('disabled-redirect');
            }
        } else {
            Mage::logException($e);
            $this->_forward('disabled-redirect');
        }
    }
}

Update** I tried performing the same rewrite on another project I'm currently on, and it appears to be working correctly. Seems the issue is my local project.


texts:
Has anyone had any success setting up MPB? I was trying to no avail to set it up and it appears to be all set up properly but when trying to access authorize.net the error message comes up This payment method not available at this time...

This is what comes through the IFrame, although when the Iframe is turned off then Auth.net works perfectly.


texts: Product name in order and invoice in of associated product

texts: I want to show the associated Product name on Magento Admin Order View and Magento Admin Order Invoice Section. Currently it is displaying the name of configurable product but I need to show the configurable's associated product sku instead of it. Please guide me so i can made changes accordingly.


texts:
I'm working on a custom Magento 2 theme and I added couple of my own elements in it. When I write (for example):

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
  .example_element{width:100px;}
}
.example_element{widht:200px;}

The code from media query is always overwritten by code below. I'm writing this code in my _theme.less file and it ends up in style-m.css. Yes I can use !important - but that is not the idea. I would like to know where do I need to write my responsive css / less code in order to work properly.

Thank you!


texts:
I have something like this

foreach ($this->getProductCollection()as $prod) { ?>
.....

And I want to reverse the foreach loop so that it starts with the last product in the array.

Is there a quick way to do this?


texts:
I am trying to create a helper that i can use from a few blocks i have extended however am getting errors.

<?php
namespace Vendor\Module\Helper;

class Promotion extends \Magento\Framework\App\Helper\AbstractHelper{

public function __construct(
    \Magento\Framework\App\Helper\Context $context,
    array $data = []
)
{
    parent::__construct($context, $data);
}

    public function testFunc() {
        return "test";
    }
}

Following error shows on page load:

PHP Fatal error:  Uncaught Error: Call to a member function dispatch() on null in /mage/root/path/vendor/magento/framework/View/Element/AbstractBlock.php:644\n

I am running in developer have cleared the var/generation folder however still i get this error. I have tried adding construct however get a range of different errors doing so wanted some advice on here about where i have gone wrong?

My helper function is being called using below code from blocks:

namespace Vendor\Module\Block;

class CategoryPromote extends \Magento\Catalog\Block\Product\ListProduct
{
public function __construct(\Vendor\Module\Helper\Promotion $promote) {
    $this->promote = $promote;
}

public function getSale() {
    $this->promote->testFunc();
}


texts:
We have recently suffered issues on our Magento 2.1.8 store which has resulted in our customers not being able to place any orders. We think this issue has now been fixed, however some customers who have already tried to checkout still cannot check out as their Order ID is persisting as Magento thinks that the order has not been fulfilled yet it is still a valid order ID.

Is there a way that we can possibly retract all Order IDS from all customers whose order has not yet been successful so they Magento can generate them a new ID the next time they checkout?

Thanks.


texts: How can I get customer_taxvat on sales flat quote in - Magento 1

texts:
public function loadAttributeOptions()
    {

    $customerAttributes = Mage::getResourceSingleton('customer/customer')->loadAllAttributes()->getAttributesByCode();
    $attributes = array();

    foreach ($customerAttributes as $attribute) {
        $attribute[] = $customerAttributes;
        if (!($attribute->getFrontendLabel()) || !($attribute->getAttributeCode())) {
            continue;
        }
        $attrCode = $attribute->getAttributeCode();
        $attrLabel = $attribute->getFrontendLabel();
        if($attrCode == 'default_shipping' || $attrCode == 'default_billing') {
            continue;
        }
        $attributes[$attrCode] = $attrLabel;
    }
    asort($attributes);
    $this->setAttributeOption($attributes);
    return $this;
}

this is my code, but I need to some validations, 1- If attributes is empty, i would like to get customer_taxvat in sales_flat_quote

You got it?


texts: Magento 1: caching SQL queries using Magento cache

texts:
Theorically, you can cache anything using Mage::app()->saveCache() and I recently came accross some code that could potentially cache the product load:

<?php

class Vendor_Module_Model_Product extends Mage_Catalog_Model_Product
{
    public function load($id, $field = null)
    {
        if (null !== $field || !Mage::app()->useCache('product_loading')) {
            return parent::load($id, $field);
        }

        // Caching product data
        $storeId = (int) $this->getStoreId();
        $cacheId = "product-$id-$storeId";
        if ($cacheContent = Mage::app()->loadCache($cacheId)) {
            $data = unserialize($cacheContent);
            if (!empty($data)) {
                foreach ($data as $key => &$value){
                    $this->$key = $value;
                }
                unset($value);
            }
        } else {
            parent::load($id);

            // You can call some heavy methods here

            try {
                $cacheContent = serialize(get_object_vars($this));
                $tags = array(
                    Mage_Catalog_Model_Product::CACHE_TAG,
                    Mage_Catalog_Model_Product::CACHE_TAG . '_' . $id
                );
                $lifetime = Mage::getStoreConfig('core/cache/lifetime');
                Mage::app()->saveCache($cacheContent, $cacheId, $tags, $lifetime);
            } catch (Exception $e) {
                // Exception = no caching
                Mage::logException($e);
            }
        }

        return $this;
    }
}

That code is a draft but theorically, that could work fine is you take the store id into consideration.

So I'm wondering :

if there is any limits / cons of caching SQL query results ?
what should I keep in mind / take into consideration if I want to implement such feature ?

Things I already got in mind:

beware of the differences in product data between two different stores
refresh the cache on product save
take care of the inventory loaded with each product load.  (maybe use __sleep / __wakeup to only load the inventory on product load)

NB: I'm aware that we usually let MySQL Query Cache take care of that, I'm just wondering how far can the Magento cache go.