texts:
I want to add some custom JavaScript in the header of the checkout page.
I tried to follow the layout structure..

I created a module and places my custom JS file is in app/code/Roman/hello/view/frontend/web/js/view

and my checkout_index_index.xml file is:

    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="head.additional">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="my-new-step" xsi:type="array">
                        <item name="component" xsi:type="string">
                            Roman_hello/js/view/hello-init.js
                        </item>
                        <item name="sortOrder" xsi:type="string">2</item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
        <referenceBlock name="checkout.root">
                <arguments>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="checkout" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="steps" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <!-- The new step you add -->
                                            <item name="my-new-step" xsi:type="array">
                                                <item name="component" xsi:type="string">Roman_hello/js/view/js_helloworld</item>
                                                <item name="sortOrder" xsi:type="string">2</item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </argument>
                </arguments>
        </referenceBlock>
    </body>
</page>

That's what I was able to pickup from different places on the web I found, but nothing seems to work..

How should I write it?


texts:
I'm looking for a good bottle deposit (in german "Pfand") extension for a Magento 2 Store.

I found an extension for Magento 1 here:
https://mage-people.com/product/bottle-deposit-deposit-fees-pfand-extension-for-magento/

The german right has extra fees on bottles called bottle deposit (Pfand in german) which you have to pay when buying a bottle.

The extension has to provide the functionality that I can add a extra bottle deposit to each product.
this extra fee needs to be displayed in the cart and checkout and ultimately the customer needs to be charged the extra fee.


texts: Custom extension to fit with existing theme

texts:
I was wondering.

If someone creates an extension, lets say the extension would show recommended products then how will the developers of that extension make sure that it would fit with customer's shop theme?

https://www.magentocommerce.com/magento-connect/frequently-bought-together-extension.html For example this extension.

Are extensions like this one only developed for one specific Magento theme or are they suitable for any theme, including customer's own custom theme?

And if so, how would they achieve something like this? So during the extension installation lets say, it would determine itself the theme and make correct changes so it would fit visually with the rest of the page.


texts:
I am trying to extend an extensions controller so I can make changes without hacking about with the vendor's code.

The extension's controller which I can trying to extend is

/app/community/Rewardpoints/controllers/IndexController.php

and it looks like the following

class Rewardpoints_IndexController extends Mage_Core_Controller_Front_Action
{
   public function quotationAction(){

   }
}

This is what I have so far

1) Enable the module by creating /app/etc/modules/Namespace_ModuleName.xml

<config>
    <modules>
        <Namespace_ModuleName>
            <active>true</active>
            <codePool>local</codePool>
             <depends>
              <Rewardpoints/>
             </depends>
        </Namespace_ModuleName>
    </modules>
</config>

2) Set up the config /app/code/local/Namespace/ModuleName/etc/config.xml

 <?xml version="1.0"?>
 <config>
      <frontend>
    <routers>
        <rewardpoints>
            <args>
                <modules>
                    <Namespace_ModuleName before="Rewardpoints">Namespace_ModuleName</Namespace_ModuleName>
                </modules>
            </args>
        </rewardpoints>
    </routers>
</frontend>
</config>

3) Set up the new control- /app/code/local/Namespace/ModuleName/controller.php

   class Namespace_ModuleName_IndexController extends Rewardpoints_IndexController
   {
        public function quotationAction()
        {
            echo 'test';
            exit;
        }
    }

The error that I am getting though is Fatal error: Class 'Rewardpoints_IndexController' not found in /app/code/local/Namespace/ModuleName/controllers/IndexController.php on line 4


texts:
I'm having a bit of a weird problem. I'm trying to run reports for 2 of my magento stores and I'm getting $0 values in all sales reports. It will show the proper order quantities as well as how many items are being ordered but any dollar amount is zeroed out. I've refreshed lifetime statistics several times but with no luck. These stores are both fairly new and this is the first time I'm trying to run reports.

I have other stores running on older magento versions without issue. The two in question are on 1.9.2 and 1.9.1


texts:
i am installing tabels for my module can i declare two classes? if not how to i combine both?

<global>
    <resources>
        <name_module_setup>
            <setup>
                <module>Name_module</module>
                <class>Mage_Core_Model_Resource_Setup</class>
                <class>Mage_Catalog_Model_Resource_Setup</class>
            </setup>
        </name_module_setup>
    </resources>
</global>


texts:
I do see the var/locks folder in my Magento installation. But it is always empty - even while the indexer is running.

I assume it will cause an issue if the indexer gets triggered more than once, is this correct?

But I can't track down why it always stays empty.

var/locks is set to 777 [drwxrwxrwx]
var/locks will be owned by the same user of var/logs (and this works)
all indexes finish successfully
Nothing related in log files
Magento ver. 1.9.2.0

I appreciate any hint and further information. Thank you.

Edit:
If I'm gonna overwrite the indexer module with one from ver. 1.8 it works like expected - the var/locks folder will be used. So it looks like Magento changed the way of using var/locks? Does anyone know more about it?

Thanks!


texts: Magento 2.3.1 | Email Sending Not working

texts:
How can email sending works (contact- orders - forgot pswd ..) without using a third-party extension ( like Mageplaza_SMTP) ??

Should i make any sort of configuration in my local server ?

Ps : I did all the needed configs in Magento Admin Panel


texts:
I'm trying to override the Topmenu Block from Catalog module, that particular class is not getting called at all.

This is the code I wrote:

app\code\HBBatteries\Topmenu\registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'HBBatteries_Topmenu',
    __DIR__
);

app\code\HBBatteries\Topmenu\etc\module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="HBBatteries_Topmenu" setup_version="2.2.0">
    <sequence>
        <module name="Magento_Catalog"/>
    </sequence>
</module>
</config>

app\code\HBBatteries\Topmenu\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Plugin\Block\Topmenu" type="HBBatteries\Topmenu\Plugin\Block\Topmenu" />
</config>

app\code\HBBatteries\Topmenu\Plugin\Block\Topmenu.php

<?php

namespace HBBatteries\Topmenu\Plugin\Block;

use Magento\Catalog\Model\Category;
use Magento\Framework\Data\Collection;
use Magento\Framework\Data\Tree\Node;

class Topmenu extends \Magento\Catalog\Plugin\Block\Topmenu
{

/**
 * Convert category to array
 *
 * @param \Magento\Catalog\Model\Category $category
 * @param \Magento\Catalog\Model\Category $currentCategory
 * @return array
 */
/*This is not getting called !!!*/
private function getCategoryAsArray($category, $currentCategory)
{
    return [
        'name' => $category->getName(),
        'id' => 'category-node-' . $category->getId(),
        'url' => $this->catalogCategory->getCategoryUrl($category),
        'has_active' => in_array((string)$category->getId(), explode('/', $currentCategory->getPath()), true),
        'is_active' => $category->getId() == $currentCategory->getId()
    ];
    }

}


texts: 500 Internal Server Error on PHP Image Load

texts:
This problem happened all of a sudden after Magento was working for 2 years.

When I load a page, a thumb.php GET request is made to load 6-7 images. Now most of them are loaded fine with a 200 response from thumb.php, but there is always 1 image that doesn't load right away and seems to be giving 500 internal server error. If I refresh the page it will load all the images without problem. It's very weird since some of the pages are loading all the images right away without any problem. Any suggestions?


texts: How can i disable Color Swatches Tooltip in Magento 2?

texts:
When i hove over magento color swatches, it shows a bigger tooltip. On Mobile this is truly not useful. I want to disable the tooltip.

Where can i disable the tooltip? I looked for  options but did not found.

Thanks!


texts: Place Order spinner stuck and not redirect to success page?

texts:
i have a big problem in magento 2.1.7
when user try to place order and click on Place Order button.. the loader spinner not stop loading
and not redirect user to the success page
and in the backend the order number is missing !
could you please help me to remove spinner after press on Place order button?
or any other solutions?
i use One Page Checkout but the same problem in regular checkout.
another problem (lot of orders are missing in database and in backend)
Thank you


texts: How to get checkout cart URL on checkout page in shipping.html template file?

texts:
I want to add an anchor link as "Return to Cart" just beside "Next" button on checkout page shipping address form. I have added an anchor tag in

  app/design/frontend/Custom/theme/Magento_Checkout/web/template/shipping.html

file just above the Next button.

What I want to know is how to get checkout cart URL in href to redirect to cart page on clicking anchor tag?

Code is something like below,

        <button data-role="opc-continue" type="submit" class="button action continue primary">

        </button>


texts: Magento 2 remove currency symbol and decimals when price is .00

texts:
We are running on Magento 2.3 and I want to remove the currency symbol from the product price and also remove the decimals when the price is .00

How can we achieve that?

I already changed the file: app/design/frontend/{{namespace}}/{{theme_name}}/Magento_Catalog/templates/product/price/amount/default.phtml to:

<?php /* @escapeNotVerified */ $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer(), 0) ?>

That works fine for the productlist page, but not the productpage.

Updating /vendor/magento/module-catalog/view/base/web/js/price-utils.js to var precision = 0, does not work well, because all prices do not have decimals in that case. But we only want to remove the decimals when the price is .00

How can we achieve that and also remove the currency symbol?


texts: Magento 2.3 - Force (product list) grid view for mobile users (no list view)

texts:
I want to force mobile users to use "Grid view" only for the Magento 2.3 catalog products page/search results page (no possiblity to switch to list view - but I want to remain list view for desktop and if possible tablet users). How can I achieve it?
Im new to programming so please don't laugh at the try from below (it doesnt work) but is it possible to do something similiar like the following in Magento_Catalog/templates/product/list.phtml file?

<?php if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($_SERVER['HTTP_USER_AGENT'],0,4))) {
    $browserStatus = 'Mobile';
}
?>

<?php if ($browserStatus = 'Mobile') {
 $viewMode = 'grid';
        $imageDisplayArea = 'category_page_grid';
        $showDescription = false;
        $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
}
?>

Thank you!


texts: how to get the store name in CMS page - Magento 1.9

texts:
I have multistore. 1. shoes.com, 2. shirt.com

Both of them have the same content, but the only difference is the name of the store (i.e shoes.com and shirt.com)

I don't want to create the same pages just for multiple store.
Is there a way, we can use the same page and use some code, might be like this {{storename}}, and its render on front-end.


texts: Magento2: How to remove login popup on minicart proceed to checkout button?

texts:
I am using magento2.4.1.
I want to remove login popup from proceed to checkout button on minicart and want to add login URL, So if guest user click on proceed to checkout from minicart it redirect customer to login page for login before checkout step.
How can I do this in my custom theme?


texts: Warning: simplexml_load_string(): Entity: line 29: parser error : StartTag

texts:
May I have Help please
Warning: simplexml_load_string(): Entity: line 29:  : StartTag: invalid element name in /var/www/magento2/vendor/magento/framework/View/Model/Layout/Merge.php on line 552


texts: Magento 2.4 admin dashboard notification error

texts:
When Login to magento 2.4 admin dashboard getting below notification error message.

A technical problem with the server created an error.
Try again to continue what you were doing. If the problem persists, try again later.

On debugging error from lib/web/mage/backend/bootstrap.js found below error.

TypeError: Argument 1 passed to
Magento\Backend\Model\Dashboard\Chart::getByPeriod() must be of the
type string, null given called in /vendor/magento/module-backend/Controller/Adminhtml/Dashboard/Chart/Orders.php on line 62

How to resolve this.


texts:
So, the question is simple, what can i do to fix what you can see in that picture?

Some js are failed, not all of them, just those 5.


texts: Reindex command line for specific store view

texts: I'm wondering is there any way to re-index the "Catalog Url Rewrites" of a specific store view in Magento with Multiple Stores. Is it possible to have store Id in indexer.php command-line?


texts: Magento 2 - add Enable / Disable field for custom module

texts:
I want to add some fields in the Magento 2 Admin Panel for my custom module and then I want to check in the phtml file if this field is have value or not.

I need to add this fields:

- enable / disable (yes/no field type) ;
- Add text {input text field type};
- upload image;

the upload image field must have the option to delete the image too.

For enable / disable I add this in the system.xml:

        <class>separator-top</class>
        Module
        <tab>mymodule</tab>
        <resource>Module_First::mymodule_configuration</resource>
        <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
            General Configuration
            <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                Enable
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
        </group>

I want to know what is the format for adminhtml/system.xml and how I can check this fields value in the phtml file (or what is the best way to check the value for this fields).

Thank you


texts: How to add css sheet to the homepage only?

texts:
I'm trying to add a CSS sheet to only the homepage.

I have copied the cms_index_index.xml to app/design/frontend/name/example/Magento_CMS/layout/cms_index_index.xml

I have added this code:

 <body>
    <head>
        <css src="name_example::css/slick-theme.css" />
    </head>
 </body>

I have flushed the cache multiple times. I do have the correct theme chosen. How do I add it?


texts: Implementing service contract Magento 2? Getting error "Class Assign\RestService\Model\ResourceModel\Hamburger\CollectionFactory does not exist"

texts:
I am implementing simple service contracts. don't have much knowledge about service contracts following example from here

How to implement service contract for a custom module in Magento 2?

i am getting error of

  "Class
  Assign\RestService\Model\ResourceModel\Hamburger\CollectionFactory
  does not exist"


texts: I want to get SKU and Order ID from Magento database and I know how to get them individually. The problem is I need to get SKU for the product that the order id points towards. I can't figure out the relation between sales_order_flat_table and catalogue_product_entity. I think there are other tables in between that I am missing. May be I should use some id in sales_flat_order_table to get product id and then get SQL.


texts:
I have a module in my shop that is only there for development purposes and can only be accessed in a special product via a cookie. All other products load module, but do not use it, as it is a special configurator.

Is it possible to enable/disable loading that module by a specified parameter, such as a specified site or a specified product?


texts:
I would like to add my company logo and phone number to a packing slip generated by Magento.  Does anyone know how to do this?  When the order confirmation email goes to the customer the company logo is there.  So I know the logo is in Magento.
Thanks


texts: Magmi Logs and how to get better records

texts:
I'm almost done with a Import tool that can use Magmi API to update the products. What I'm looking for is a way to log the failed updates so if I need to build a 're'queue system, I will. This cron will run every 10 minutes. It's just a lot of data and I need to make sure that everything is always in Sync.

The datapump is going from MySQL to Magento. I'm open for other suggestion to on importing/updating product from another MySQL table. However, Magmi seems to be the closest for us right now.


texts: Magento2: How to mass update the custom table status from ui component grid

texts:
I have a ui component grid in admin which displays data from the custom table multivendor_product in which id is the primary key of the table and another field product_id is the product ID catalog_product_entity.entity_id. Here is the massaction tag in ui-component xml file,

        <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
        <action name="status">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">status</item>
                    <item name="label" xsi:type="string" translate="true">Actions</item>
                </item>
            </argument>
            <argument name="actions" xsi:type="array">
                <item name="0" xsi:type="array">
                    <item name="type" xsi:type="string">approve</item>
                    <item name="label" xsi:type="string" translate="true">Approve</item>
                    <item name="url" xsi:type="url" path="mymarketplace/product/massStatus">
                        <param name="status">1</param>
                    </item>
                </item>
                <item name="1" xsi:type="array">
                    <item name="type" xsi:type="string">disapprove</item>
                    <item name="label" xsi:type="string" translate="true">Disapprove</item>
                    <item name="url" xsi:type="url" path="mymarketplace/product/massStatus">
                        <param name="status">2</param>
                    </item>
                </item>

            </argument>
        </action>
    </massaction>

Now when I select the records and select one of the action, it is taking me to the controller Custom/Marketplace/Controller/Adminhtml/Product/massStatus.php, but I am not able to update the table.
What I would like is to update the table with the new status and also if the disapprove action is selected then disable the product also.

Could someone please help me with this.
Thank you in advance


texts: Magento2 Rest Api to Delete an item after place order

texts:
Can anyone help me how to remove an item from an order after order completion using resti api in magento2

Thanks


texts: Magento2 : Parse error: syntax error, unexpected ' ' (T_STRING), expecting function (T_FUNCTION) in Index.php

texts:
<?php

namespace Cloudways\MyModule\Controller\Index;

use Magento\Framework\App\Action\Action;

use Magento\Framework\App\Action\Context;

use Magento\Framework\View\Element\Messages;

use Magento\Framework\View\Result\PageFactory;

class Index extends \Magento\Framework\App\Action\Action
{

    /** @var PageFactory $resultPageFactory */
    protected $resultPageFactory;

     /**
     * Result constructor.
     * @param Context $context
     * @param PageFactory $pageFactory
     */
    public function __construct(Context $context, PageFactory $resultPageFactory)
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }
    /**
     * Blog Index, shows a list of recent blog posts.
     *
     * @return \Magento\Framework\View\Result\PageFactory
     */
    public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->prepend(__('Custom Front View'));
        return $resultPage;

    }
}


texts:
I have a block with a visual menu in it and I want to show up centered on the page. This is my css within the block:

.container{
margin: 0 auto;
text-align:center;
}

I've also tried to put the widget when inserted into the page inside a centered div:

<div style="text-align: center;" >
{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="38" type_name="CMS Static Block"}}
</div>

What else can I do to center it?


texts: Magento 2.4 Track this shipment link error on open Popup

texts:
I was trying to implement a custom shipping label programmatically but I'm getting error below:
Error: Call to undefined method Magento\Framework\Phrase::getTracking()....

I am using \Magento\Sales\Api\Data\ShipmentTrackInterfaceFactory to create tracking and my custom carrier is extending AbstractCarrier.
Everything seems to work fine except for the links that open the pop up. Links are:

Track this shipment and
Track order

both under Shipping & Handling Information and Shipping and Tracking Information.
Update: I found this on github upon googling but I don't think the solution will work for me as this is a custom module.


texts:
I added below script to validate url in my form field. It shows valid url.Even if i use magento default class validate-url It won't show error.

$url=https://www.google.co

if(!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$url))
{
  echo "invalid url";
}
else
{
   echo "valid url";
}

How to fix this issue.


texts: How to check if visitor has visited before?

texts:
I'm developing a referral module that allows users to join a referral program.

Only visitors who come from a referral link AND have not visited the site before will be counted as referred user.

Is there any built-in Magento data to determine if user has been on the site before?

Otherwise, should I declare new session data for this purpose?

I suppose I must declare new session data, the get/set processes would be fired globally on every pages. How to reduce get/set processes? What is the best (better) practice of this purpose?

P/s: Answers with some code snippets are better but not required.

EDIT to make it clear: If a vistor has visited the site before by other ways (such as direct link, search engine,..), then visits the site again by a referral link, this user is NOT a referred user.


texts: Category Toolbar Showing Incorrect Count and Paging Not Working

texts:
I've got a problem with a live site where the toolbar is showing the incorrect product count, not changing sort direction or filter nor is it changing the product on pagination change.

You can see it here - Tuckers Butchers Poultry

It is showing 1-33 of 33 products where the filter count is set to 20

If you click page 2 at the bottom of the page, it changes to "21-53 of 33" but the shown products remain the same.

If you choose price "descending" , again, the page refreshes but the products remain the same.

I have a development site running the same code base that works fine, both are running Magento 2.3.3

The only difference is the live site has docroot set to /pub/ and I wondered if anyone else has seen this happen??

Oddly, the toolbar works ok in Search results.

Would really appreciate your help.


texts: Magento - change of product quantity and status is not working in an event

texts:
I have created an event which checks that if the backorder quantity of an item is greater than zero than set the ordered product quantity to zero instead of keeping it in negative and also change its status to out of stock but nothing works.

config.xml

<sales_order_place_after>
                <observers>
                    <some_random>
                        <class>My_Model_Observer</class>
                        <method>checkBackOrder</method>
                    </some_random>
                </observers>
            </sales_order_place_after>

Observer.php

public function checkBackOrder($observer)
    {
        $order = $observer->getOrder();
        $customer = $order->getCustomer();
            foreach ($order->getAllItems() as $item)
            {
                if ($item->getProductType() == 'simple') {
                    $product = Mage::getModel("catalog/product")->load($item->getProductId());

                    if ($item->getQtyBackordered() > 0) {
                        $webQty = $product->getStockItem()->getQty();
                    if ($webQty <= 0) {
                        $this->_changeStockStatus($product);
                      }
                    }
                }
            }
    }

protected function _changeStockStatus($product)
    {
        $webStockId = Mage::app()->getWebsite()->getStockId();
        $store = Mage::app()->getStore()->getStoreId();

        $stockItem = Mage::getModel('cataloginventory/stock_item')->setStoreId($store)->loadByProduct($product->getId());
        $stockItem->setData('qty', 0);
        $stockItem->setIsInStock(false)->setStockId($webStockId)->save();
    }

As you can see in the code that I am not doing something complex except trying to change the item quantity and setting it status to "Out of stock" but when I execute this code it does not change the quantity or the status of an item.

Can someone please tell me what I am doing wrong here?


texts: Magento 2 - URL rewrites - check if target path exists in URL rewrite management

texts:
I need to redirect my customers when a 404 page is thrown. To achieve this, I need to check whether a particular target path exists in the url rewrite management table.

For example : if my target path is "category1/category2/product1", how would I check that this target path is present in the url rewrite management table, and how to retrieve all information / entries matching the target path shown above ?


texts: Magento 2.2 Rest API not working for Sales Orders and Customers

texts:
We are trying to get Customers and Sales Orders from Magento 2.2 Store using token.After creating API Username and Roles, with the same request we can retrieve products but not sales orders and customers.

public function getOrders()
{
    $searchCriteria = '?searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]='.$this->from.'&searchCriteria[filter_groups][0][filters][0][condition_type]=from&searchCriteria[filter_groups][1][filters][1][field]=updated_at&searchCriteria[filter_groups][1][filters][1][value]='.$this->to.'&searchCriteria[filter_groups][1][filters][1][condition_type]=to';
    $requestUrl = $this->Url.$this->apiUrl.$this->orders.$searchCriteria;
    $headers = array("Authorization: Bearer $this->token");
    $ch = curl_init();
    ch = curl_init($requestUrl);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $result = curl_exec($ch);
    return $result;
}


texts: user role to be only allowed access and auto logged into the admin backend from ip address

texts:
I have employees who use a specific admin back end role, so i want the user role to be only allowed access and if possible to be auto logged into the admin back end from ip address when they visit the admin back end url

i have the main super admin and i want to make sure this will be normal and can use the admin back end as normal from any ip


texts: Manage Stock only option available is Yes

texts:
When I go to advanced inventory and want to set Manage Stock to No I only have the option Yes available. But why?

I have no idea where to start debugging any clue would be appreciated or maybe someone faced the same problem?

I already checked Stroes > Settings > Configuration > Catalog > Inventory settings and they look fine.

I don't know if it's related but how I found this bug was because a product I just created is apparently not salable and not listed in cataloginventory_stock_status table.

Update:
I figured out a bit more. The same problem affects Qty Uses Decimals too. In Magento_Ui/js/form/element/select::setOptions the following options are set for the selects Manage Stock, Qty Uses Decimals and Allow Multiple Boxes for Shipping:

this.optionsis set to the result of parseOptions() which gets data passed. In two of the cases the value 0 for label "No" is passed as integer and once as string. That's why parseOptions() will set the label to ' '.

The label is ' ' but the source code for the select then is <option data-title value="0"></option> can anyone explain this or has an idea why?
Does anyone know where the data for the options is passed to the select ui component?


texts: How to get State Code from Region Id in Magento 2.1.9

texts:
I am trying to get state code form Region ID.
e.g. If my region id = 12 state code should be CA.
This is what I am doing right now.

$regionObject = $objectManager->get('Magento\Directory\Model\RegionFactory');
$regionModel = $regionObject->create();
$region = $regionModel->loadByCode($regionId, $countryCode);
$shipFromState = $region->getName();

I am trying to get shipping origin address. If there is a good way to get the address that will be nice. Currently I am getting shipping information using following code

$scopeConfig = \Magento\Framework\App\ObjectManager::getInstance()
                ->get('\Magento\Framework\App\Config\ScopeConfigInterface');
$regionId = $scopeConfig->getValue('shipping/origin/region_id', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);


texts: Magento 1.9: How to translate TITLES and TITLES OPTIONS of the "Custom Options" of simple products?

texts:
I need to translate all the TITLES and OPTION TITLES of the Custom Options related to simple Magento products.
The need is:
1- Export all the fields of the "custom Option"
2- Translate them (or how to modify them)
3- Import them into the desired shop view.

I am already working with mass exports / imports throughout the catalog using the "attribute codes" of Magento attributes, including customized ones, by exporting from "Dataflow" and choosing which attributes to export. All these attributes are available from the Magento Backend: Catalog / Attributes / Attribute management> List of all attributes.
And therefore selectable in "dataflow".

But those of the "CUSTOM OPTIONS" are not present !!
How then can we export those present in the base shop, and subsequently import them?

I have been looking for a lot of absolution, but still nothing.
thanks a lot


texts: Magento ERR (3): Warning: Invalid argument supplied for foreach() in /home/onyxclot/public_html/shell/abstract.php on line 144

texts:
I have checked my System.log to find im getting the above error, the below is the code from line 144, would any body be able to advise on how to resolve.

    foreach ($_SERVER['argv'] as $arg) {
        $match = array();
        if (preg_match('#^--([\w\d_-]{1,})$#', $arg, $match) || preg_match('#^-([\w\d_]{1,})$#', $arg, $match)) {
            $current = $match[1];
            $this->_args[$current] = true;
        } else {
            if ($current) {
                $this->_args[$current] = $arg;
            } else if (preg_match('#^([\w\d_]{1,})$#', $arg, $match)) {
                $this->_args[$match[1]] = true;

other errors include

  2016-12-23T19:30:02+00:00 ERR (3): Warning: Invalid argument supplied for foreach()  in /home/onyxclot/public_html/shell/abstract.php on line 144

  2016-12-23T19:35:03+00:00 ERR (3): Warning: strpos(): Empty needle  in /home/onyxclot/public_html/lib/Zend/Controller/Request/Http.php on line 508

  2016-12-23T19:35:03+00:00 ERR (3): Warning: strpos(): Empty needle  in /home/onyxclot/public_html/lib/Zend/Controller/Request/Http.php on line 514

  2016-12-23T19:35:03+00:00 ERR (3): Warning: session_start(): Cannot send session cookie - headers already sent  in /home/onyxclot/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 133

  2016-12-23T19:35:03+00:00 ERR (3): Warning: session_start(): Cannot send session cache limiter - headers already sent  in /home/onyxclot/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 133


texts: Shopping cart rule not applying to shipping

texts:
Currently, I'm using a flat rate table to make any shipping for a cart with more than, for example, $100, become $0 instead of $3.

$shippingAddress = $quote->getShippingAddress();
 $shippingAddress->setCollectShippingRates(true)
                 ->collectShippingRates()
                 ->setShippingMethod('tablerate_bestway');

However, the client wants to do special promotions where free shipping becomes available, either through coupons or for a specific amount of time.

The problem is, the Shopping Cart Price Rules are not applying to the cart, and the shipping remains the same even when the conditions of the rule are met. For example, if I set free shipping for today, I still get $3 as shipping in the cart.

  totals: {
  subtotal: 29,
  shipping: 3,
  tax: 0,
  discount: 0
  }

Do I have to check the shopping cart rules myself and force free shipping as a method? Or is something else wrong?

Edit: Here's a screenshot of the rule as requested:


texts: Module database install debugging in Magento 2.2

texts:
I know there are many questions like this but after two days I am still unable to get the install method to build my database table in my module.

/app/code/me/HelloWorld/Setup/InstallSchema.php

namespace Me\HelloWorld\Setup;

use \Magento\Framework\Setup\InstallSchemaInterface;
use \Magento\Framework\Setup\ModuleContextInterface;
use \Magento\Framework\Setup\SchemaSetupInterface;
use \Magento\Framework\DB\Dbl\Table;

/**
 * Class InstallSchema
 *
 * @package Me\HelloWorld\Setup
 */
class InstallSchema implements InstallSchemaInterface {

/**
 * Install Posts table
 *
 * @param SchemaSetupInterface $setup
 * @param ModuleContextInterface $context
 */
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

    $tableName = $setup->getTable("me_blog_post");

    if ($setup->getConnection()->isTableExists($tableName) != true) {
        $table = $setup->getConnection()
            ->newTable($tableName)
            ->addColumn(
                'post_id',
                Table::TYPE_INTEGER,
                null,
                [
                    'identity' => true,
                    'unsigned' => true,
                    'nullable' => false,
                    'primary' => true
                ],
                'ID'
            )
            ->addColumn(
                'title',
                Table::TYPE_TEXT,
                null,
                ['nullable' => false],
                'Title'
            )
            ->addColumn(
                'content',
                Table::TYPE_TEXT,
                null,
                ['nullable' => false],
                'Content'
            )
            ->addColumn(
                'created_at',
                Table::TYPE_TIMESTAMP,
                null,
                ['nullable' => false, 'default' => Table::TIMESTAMP_INIT],
                'Created At'
            );
        $setup->getConnection()->createTable($table);
    }

    $setup->endSetup();
}

}

I have:

cleared cache,
deleted record from setup_modules in DB and reinstalled about 20 times,
run bin/magento setup:di:compile,
chmod 777 -R var/

And pretty much everything else anyone has suggested on here.

The most frustrating thing is the complete lack of error feedback in the "sudo bin/magento setup:upgrade" command.

So...

Can anyone see any errors in the code?
Is there any way I can get some feedback on the "InstallSchema.php"


texts: What does Category's attribute is_anchor do?

texts:
I'm doing some sample tests from Magento 2 certification. There's this question (screenshot) I don't understand.

The correct answer for this question is A "This is the default category for a website", but according to my knowledge (I have been working with Magento for many years), if we turn Anchor on for a category, it's just enable the layered navigation for this category.

I wonder why the correct answer is"This is the default category for a website" when is_anchor is set to 1? can someone please explain?


texts:
I have a store which sells spices. We need customer to order more than 500gm of spices.
Whats the best way to checkout from cart by minimum weight of the product.
Eg I dont want the order if the amount of spices is under 500gm


texts:
How I can translate placeholder text Enter your password * ? I need edit this code?

    <input name="login[password]" placeholder="<?php echo __('Enter your password *'); ?>" type="password" <?php if ($block->isAutocompleteDisabled()) :?> autocomplete="off"<?php endif; ?> class="input-text form-control" id="pass" title="<?php /* @escapeNotVerified */ echo __('Password') ?>" data-validate="{required:true}">


texts:
A module created a translation file in app/locale/en_US/preorder.csv.

I copied this file to app/locale/de_DE/preorder.csv but when I use $this->__("xxx") in the said module and have "xxx","yyy" in the preorder.csv file in de_DE it does not get translated. When I put "xxx","yyy" in Mage_Customer.csv in the same de_DE directory it gets translated.

So my question is, do I have to register new csv translation files somewhere? I thought all csv files in this directory will be taken.

Edit: When I rename the file like the modules: Webkul_Preorder.csv name then it works. SO magento does not take all CSV files in app/locale?


texts: Hosted checkout page - who holds liability if there is fraud case?

texts:
We are planning to use the hosted checkout page - does it minimize our liability and security measures? In the event of hacking of our website or poor security of the website, does it affect the customer's credit card information?

If there is a fraud case, is it our liability or hosted payment gateways liability? I read that you need lot of security to use the non-hosted payment gateway.


texts: How to use setup scripts for your module?

texts:
I realize, you can use setup scripts for your own module by declaring them in the etc/config.xml file of your module within the <global> space like this:

<resources>
    <catalog_setup>
        <setup>
            <module>Mage_Catalog</module>
            <class>Mage_Catalog_Model_Resource_Setup</class>
        </setup>
    </catalog_setup>
</resources>

Some modules then use the file mysql4-install-0.0.1.php whereas others use install-0.0.1.php.
So when do I use the mysql4 in front of the file name and when do I not use it?

Also, what can I do when my setup script is not running to find out why it is not?


texts: Product image size issue - Fotorama - Magento EE 2.2.4

texts:
I have issue in image height calculation in fotorama in Magento EE 2.2.4.
The image div(fotorama__stage)height is assigning by Script as inline css.

It is happens in some products only.

<div class="fotorama__stage" data-fotorama-stage="fotorama__stage" style="width: XXXpx; height: XXXpx;">

This is the perfect height assigned to the div as per image size.

This is the imperfect height assigned to the div as per image size.

Sometimes it displays perfect image as per actual image size but sometimes it displaying incorrectly.

I'm using Magento EE 2.2.4 with production mode.
I have only configurable products in this project.

Anyone know about such kind of issue?


texts: Collection - call to a member function getId() on a non object

texts:
I have the following code which shows 5 products from the current category (which has cat ID:63):

$_helper    = $this->helper('catalog/output');
$_category  = $this->getCurrentCategory();
$collection = $_category->getProductCollection();
Mage::getModel('catalog/layer')->prepareProductCollection($collection);
$numProducts = 5;
$collection->setPage(1, $numProducts)->load();

This works fine but i want to adjust this further so it only show products that are also found in another category (cat ID:71) with $collection->addCategoryFilter(71); but when i do this i get the error:

Fatal error: Call to a member function getId() on a non-object in

Full code is:

$_helper    = $this->helper('catalog/output');
$_category  = $this->getCurrentCategory();
$collection = $_category->getProductCollection();
Mage::getModel('catalog/layer')->prepareProductCollection($collection);

// this line throws the error
$collection->addCategoryFilter(71);

$numProducts = 5;
$collection->setPage(1, $numProducts)->load();

foreach($collection as $_product){
    // output products...
};


texts: what is the optimal system configuration for running Magento 2 EE on a laptop with xampv3.2.2

texts:
I need to work on Magento 2 EE and I have installed xamp 3.2.2 on windows 8.1 pro with 8GB RAM. I am on developer mode, cache is disabled and its running too slow, say it Admin login, frontend page load, and also the commands like

php -dmemory_limit=6G bin/magento setup:di:compile

php -dmemory_limit=6G bin/magento setup:static-content:deploy

etc.,

Please tell what system configuration/hardware is recommended for this case.


texts: Is it possible to extend a default layout xml in magento

texts:
Is it possible to extend a default layout xml or any default xml like page xml in magento? Not overriding them.

I would like to create a different template for specific pages in Magento.


texts: Remove add to cart button for some products

texts:
The company I work for provide a free extension to implement a common B2B requirements in a Magento shop (this is not a plug but a cry for help honest). The request has come in to provide a system config option to remove the Add to cart button, sounds simple enough as we already do this for other items such as price and cart links.

Let me explain a little bit of how I have tried to solve this so far.

We have provided the user with the option via the admin section including config options as to how to identify there Add to cart button. This defaults to the magento standard template information but should allow for different themes

You can select the type of html element (div/a/button etc.)
You can select to to identify by id or class
You can enter the value of the id or class

Then using an observer on the event core_block_abstract_to_html_after and block Mage_Catalog_Block_Product_List (we do check more blocks) we build a regular expression which gets run over the html and replaces the button with some helpful text.

This works "well", but the problem I have is that our module can be activated on a category level. Obviously this means that you could have a search result page with both active and inactive categories. Currently our approach will just remove all Add to cart buttons in this block even on active products as it can not check on a product basis.

Our module code can be found at https://github.com/sitewards/B2BProfessional/tree/add-to-cart if you want to take a quick look. I am happy to answer more questions if people have any suggestions.


texts: How to override core Interface and Model file in magento2?

texts:
How to override core Interface and Model file in magento2...

I need to remove current password in change password frontend section.In current password validate in \Magento\Customer\Controller\Account\EditPost Controller file and its call core interface also .How to remove this.

Edited:
It does not solve my problem ..I want customise core api interface not to add additional functionality...Also AccountManagement.php does not have extension attribute


texts: Add row number in admin custom table Magento 2

texts:
I've made a new module.
Here, I've override the AbstractFieldArray class.
    <?php
namespace myVendor\myModule\Block\System\Form\Field;

use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;
use Magento\Framework\DataObject;
use Magento\Framework\Exception\LocalizedException;
use myVendor\myModule\Block\System\Form\Field\ShowReasonColumn;

class Multi extends AbstractFieldArray {
    /**
     * @var \Magento\Framework\Data\Form\Element\Factory
     */
    protected $_elementFactory;
    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory
     * @param array $data
     */

    private $showReason;

    protected $_template = 'myVendor_myModule::system/config/form/field/array.phtml';

    public function __construct(
    \Magento\Backend\Block\Template\Context $context, \Magento\Framework\Data\Form\Element\Factory $elementFactory, array $data = []
    ) {
        $this->_elementFactory = $elementFactory;
        parent::__construct($context, $data);
    }

    protected function _prepareToRender() {
        $this->addColumn('id', ['label' => __('ID'), 'readonly'=>'readonly']);
        $this->addColumn('message', ['label' => __('Message'), 'class' => 'required-entry']);

        $this->addColumn('show_reason_frontend', [
            'label' => __('Showin Frontend'),
            'renderer' => $this->getShowFrontend()
        ]);

        $this->_addAfter = false;
        $this->_addButtonLabel = __('Add');

    }

    protected function _prepareArrayRow(DataObject $row): void
    {
        $options = [];

        $showFrontend = $row->getShowFrontend();

        if ($showFrontend !== null) {
            $options['option_' . $row->getShowFrontend()] = 'selected="selected"';
        }

        $row->setData('option_extra_attrs', $options);
    }

    private function getShowFrontend()
    {
        if (!$this->showReason) {
            $this->showReason = $this->getLayout()->createBlock(
                ShowReasonColumn::class,
                '',
                ['data' => ['is_render_to_js_template' => true]]
            );
        }
        return $this->showReason;
    }
}

My output in admin is this:

I would like an auto-incremented ID (it should show the row number, Ex: 1,2)
P.S. I don't have a delete action so it needs only to increment every time I'm adding a new row. Also, I will use this ID in my DB.


texts: Some added products in cross sells not visible in frontend Magento 2

texts:
I have added few products in cross-sells but some are visible and some are not visible in the UI(frontend).

I referred to a Magento bug that only 2 items were visible in the backend

  https://github.com/magento/magento2/issues/13720

Is this related to Magento 2 bug, How can I solve this bug.

  Catalog/Model/ProductLink/CollectionProvider.php

 class CollectionProvider extends \Magento\Catalog\Model\ProductLink\CollectionProvider
{

    /**
     * @var CollectionProviderInterface[]
     */
    protected $providers;

    /**
     * @var ConverterPool
     */
    protected $converterPool;

    /**
     * @param ConverterPool $converterPool
     * @param CollectionProviderInterface[] $providers
     */
    public function __construct(ConverterPool $converterPool, array $providers = [])
    {
        $this->converterPool = $converterPool;
        $this->providers = $providers;
    }

    /**
     * Get product collection by link type
     *
     * @param \Magento\Catalog\Model\Product $product
     * @param string $type
     * @return array
     * @throws NoSuchEntityException
     */
    public function getCollection(\Magento\Catalog\Model\Product $product, $type)
    {
        if (!isset($this->providers[$type])) {
            throw new NoSuchEntityException(__("The collection provider isn't registered."));
        }

        $products = $this->providers[$type]->getLinkedProducts($product);
        $converter = $this->converterPool->getConverter($type);
        $sorterItems = [];
        foreach ($products as $item) {
            $itemId = $item->getId();
            $sorterItems[$itemId] = $converter->convert($item);
            $sorterItems[$itemId]['position'] = $sorterItems[$itemId]['position'] ?? 0;

        }

        usort($sorterItems, function ($itemA, $itemB) {
            $posA = intval($itemA['position']);
            $posB = intval($itemB['position']);
            return $posA <=> $posB;
        });

        return $sorterItems;

    }

}

This was the fix for only a few products showing in the backend(admin panel).

How can I fix the same issue for frontend? All cross-sell products are visible in the backend now but not visible in the frontend(UI).


texts: Observer on Adminhtml product grid not getting colection

texts:
Having some issues with an observer on the EAV product collection event for the Adminhtml product grid.

I am simple trying to add 2 new columns into the grid. Heres my XML:

 <adminhtml>
    <events>
        <adminhtml_block_html_before>
            <observers>
                <vendor_module>
                    <class>vendor_module/adminhtml_observer</class>
                    <method>onBlockHtmlBefore</method>
                </vendor_module>
            </observers>
        </adminhtml_block_html_before>
        <eav_collection_abstract_load_before>
            <observers>
                <vendor_module>
                    <class>vendor_module/adminhtml_observer</class>
                    <method>onEavLoadBefore</method>
                </vendor_module>
            </observers>
        </eav_collection_abstract_load_before>
    </events>
</adminhtml>

This calls these 2 methods:

public function onBlockHtmlBefore(Varien_Event_Observer $observer) {
    /** @var Mage_Adminhtml_Block_Widget_Grid $block */
    $block = $observer->getBlock();
    if (!isset($block)) return $this;

    if ($block->getType() == 'adminhtml/catalog_product_grid') {

        Mage::getModel('vendor_module/adminhtml_product_grid')->buildNewColumns($block);

    }
}

public function onEavLoadBefore(Varien_Event_Observer $observer) {
    /** @var Mage_Eav_Model_Entity_Collection_Abstract $collection */

    $collection = $observer->getCollection();
    if (!isset($collection)) {
        return $collection;
    }

    $collection
        ->addAttributeToSelect('gender')
        ->addAttributeToSelect('season');

    $observer->setCollection($collection);

}

The columns get outputted fine, but for some reason the data of season and gender doesn't get appended to the collection. After step debugging it seems that this observer doesn't get the collection at all or should i say there are no items in the collection.

Have any ideas? I assume that when i have the collection successfully and update the attributes being selected that they will show in the Grid for each product?

Magento 1.6.2.0


texts: How to view discount amount in cart for each product row?

texts: Is it possible to show the discount amount for each product row inside the cart? Price rules are set inside the catalog


texts: How to increase cross-sell products display limit in magento 2?

texts:
When i am adding upsell product it is showing more then 4 on product page.
But when i am assigning more then 4 product to cross-sell it's only showing 4 product on cart page.

I want to show more then 4 product in cross-sell.


texts: Magento 2: Custom Module URL Key Magento Function

texts:
I'm using Magento 2 CE Version 2.1.0.

I'm creating a custom module. For saving data I'm using custom INSERT query.

In that INSERT query, i also need to save URL Key/Identifier which is going to display on Browser URL while user access.

URL Key will be a replica of Post Title. Title Contains Example: Hi Can't Save Dat``a.

if (empty($model->getData('url_key'))) {
    $urlKey = str_replace(" ", "-", strtolower($model->getData('url_key')));
}

$sql = "INSERT INTO `post` (`title`, `url_key`) VALUES ('" . $model->getData('title') . "', '" . $urlKey . "');";
$connection->query($sql);

In URL Key, we have `, `` or any the characters. What can I use as a function, which Magento uses to store product's URL Key in my Custom Module?

So I don't have to write multiple str_replace functions.

Thanks


texts:
we have a Magento installation @ Mage 1.7. We've been around since 1.3 ...

What we are seeing more and more is that certain indexes appear that are no longer in Mage 1.7. For example we have an index IDX_OZSS_CORE_CACHE_EXPIRE_TIME on core_cache that does not exist in the latest install.

Now I have used the DB repair tool: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool - it does ADD missing indexes, but does it remove unused ol dindexes etc?

So my question is: how would I clean my database setup to match the latest Magento install using all the right indexes? (adding missing,and removing obsolete)


texts: Magento2 - Removing exist item during update items from cart :

texts:
Magento2 - I am doing some customisation work on cart page. I want to add product multiple times with same configuration during update items. Add to cart is working good but existing items get removed during update items. Here is the code, which I am using

I have overridden update controller ie. vendor/magento/module-checkout/Controller/Cart/UpdatePost.php and customize the _updateShoppingCart method.

foreach($cartCustomData as $key => $data) {
  $superAttributeData = $data['super_attribute'];
  $params = $data['custom_param'];
  $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($data['product']);
  $this->cart->addProduct($_product,$updateParams);
}

$this->cart->save();

this works but when

$this->cart->updateItems($cartData)->save();

This is removing the exist one item.

Thanks in advance. Any help would be appreciated.

Updated :

protected function _updateShoppingCart()
    {
        try {
            $cartData = $this->getRequest()->getParam('cart');
            $cartCustomData = $this->getRequest()->getParam('cart_custom_data');

            if (is_array($cartData)) {
                $filter = new \Zend_Filter_LocalizedToNormalized(
                    ['locale' => $this->_objectManager->get(
                        \Magento\Framework\Locale\ResolverInterface::class
                    )->getLocale()]
                );
                foreach ($cartData as $index => $data) {
                    if (isset($data['qty'])) {
                        $cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
                    }
                }
                if (!$this->cart->getCustomerSession()->getCustomerId() && $this->cart->getQuote()->getCustomerId()) {
                    $this->cart->getQuote()->setCustomerId(null);
                }

                //* custom code *//
                foreach($cartCustomData as $key => $data) {
                  $superAttributeData = $data['super_attribute'];
                  $params = $data['custom_param'];
                  $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($data['product']);
                  $this->cart->addProduct($_product,$updateParams);
                  $this->cart->save();
                }
                //* custom code *//

                $cartData = $this->cart->suggestItemsQty($cartData);
                $this->cart->updateItems($cartData)->save();
            }
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
            $this->messageManager->addError(
                $this->_objectManager->get(\Magento\Framework\Escaper::class)->escapeHtml($e->getMessage())
            );
        } catch (\Exception $e) {
            $this->messageManager->addException($e, __('We can\'t update the shopping cart.'));
            $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
        }
    }


texts: What´s the Magento Community equivalent to Magento Enterprise 1.7.1

texts:
I have a client using Magento Enterprise 1.7.1 and I was wondering what's the equivalent for that in Magento Community?

Could anyone help?

Thanks


texts: Editing Magento Admin and User order detail page

texts:
This is a cross-post from stackoverflow, where nobody has been able to help so far.

I'm trying to add a minimal, manual "track shipment" system in Magento. Here's what I'm trying to do:

I'd like to have radio buttons on the admin order detail page to select where the shipment is (e.g. not yet shipped, on its way, arrived). When I select one and press submit, I'd like for the customer to see the information on his/her order detail page.

I've managed to add radio buttons on the admin side by editing this file-- app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml --but I believe that it will be overwritten if Magento is updated. The same is true for edits on the customer side file-- app/design/frontend/base/default/template/sales/order/info/buttons.phtml

Also, the buttons don't actually do anything yet. I think what I need to do might be to add a column to Sales_Flat_Order (for the order to have a shipping state) and Sales_Flat_Order_Grid (for the admin to be able to see its current state). Then, the radio buttons could somehow change the state in this table, and when the customer page is loaded, it could retrieve the state and display it.

Summary of questions:

How can I edit the order detail pages (admin's and customer's) in a sustainable way
Should I just make a new table column in phpMyAdmin, or must it somehow be done through Magento?
Can I somehow use radio buttons to change a table?
Can I then retrieve that information and display it on the customer order detail page?

Any guidance, however partial, would be greatly appreciated. I've been beating my head against google to get this far, but I don't feel that much closer to actually solving the problem.


texts: Magento2 - checkout remove dropdown from billing address and show as shipping address block

texts:
I have requirement to change the billing address design of dropdown to blocks as shipping address design in magento2.3
Actual:

Expected: The all billing address should show in blocks as shipping.


texts: Issue with country and region field in custom module using ui-component

texts:
I am trying to add country and region fields in my custom module in admin section. I have managed to populate the country field values, but while selecting country, unable to get the regions.

This is my xml code :

<field name="country_id">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Magento\Directory\Model\Config\Source\Country</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Country</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/country</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="source" xsi:type="string">address</item>
                    <!--<item name="dataScope" xsi:type="string">country_id</item>-->
                    <item name="imports" xsi:type="array">
                        <item name="default" xsi:type="string">${ $.provider }:data.customer.website_id</item>
                    </item>
                </item>
            </argument>
        </field>

         <field name="region">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">false</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">address</item>
                </item>
            </argument>
        </field>

        <field name="region_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="source" xsi:type="string">address</item>
                    <item name="customEntry" xsi:type="string">region</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                    <item name="filterBy" xsi:type="array">
                        <item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.country_id</item>
                        <item name="field" xsi:type="string">country_id</item>
                    </item>
                </item>
            </argument>
        </field>

Let me know where I am wrong or if anything is missing here...

Any help  would be appreciated :)


texts: Configurable Product - Select Size with Button

texts:
I have this design below for my product page;

I have also setup a Configurable Product for the pillows and have everything working, however I would like to be able to select the sizes using a button, rather than a dropdown (circled in red, in image above).

Is there a way to do so, or any ideas?
I am using Magento ver. 1.9.2.3


texts: Magento 2 Catalog price rule on special price

texts:
Currently Magento is using the special price if it is lower than the applied catalog price rule. If the catalog price rule makes the product cheaper than the special price, then the catalog price rule defines the shop price.

  I am looking for an elegant way to make catalog price rules be applied to the special price (additionally). Maybe there is some store config for it? Maybe there is some neat observer way?

EDIT
I thought about editing the rule.php inside vendor/magento/module-catalog-rule/Model/RessourceModel to check the already placed special price (there is a solution like that for magento 1.8) but im kinda stuck there

public function getRulePrices(\DateTimeInterface $date, $websiteId, $customerGroupId, $productIds)
{
    $connection = $this->getConnection();
    $select = $connection->select()
        ->from($this->getTable('catalogrule_product_price'), ['product_id', 'rule_price'])
        ->where('rule_date = ?', $date->format('Y-m-d'))
        ->where('website_id = ?', $websiteId)
        ->where('customer_group_id = ?', $customerGroupId)
        ->where('product_id IN(?)', $productIds);

    return $connection->fetchPairs($select);
}

public function getRulesFromProduct($date, $websiteId, $customerGroupId, $productId)
{
    $connection = $this->getConnection();
    if (is_string($date)) {
        $date = strtotime($date);
    }
    $select = $connection->select()
        ->from($this->getTable('catalogrule_product'))
        ->where('website_id = ?', $websiteId)
        ->where('customer_group_id = ?', $customerGroupId)
        ->where('product_id = ?', $productId)
        ->where('from_time = 0 or from_time < ?', $date)
        ->where('to_time = 0 or to_time > ?', $date);

    return $connection->fetchAll($select);
}


texts: After upgrade to magento 2.3.2 images slow loading

texts:
After an ugrade from 2.2.8 to 2.3.2 images are loading very slow, especialy the first load. Also CPU is much higher then with 2.2.8.

I have an Nginx apache redis config.

How to speed up (fist time) image loading


texts:
yestarday I discovered this problem in Magento, if I try to signup from the frontend with a new account, after filling all fields and push the signup button the page load and it show up a blank page with this:

string: {my_password} (in my_password is shown the password I have used to signup)

So I thought was something related to the frontend, I decided to signup the account manually from the Backend, the result is that when I save the account, the backend load a blank page with the word:

NULL

So I open up the console in firefox, nothing, at this point I enabled the system logs, and do again the procedure, and this is what the log tell when I try to manually signup the account from the backend (even if I try to edit an existing account).

ERR (3): User Error: Some transactions have not been committed or rolled back  in /magentostore/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 3937

I really don't understand what to do, and what is causing the issue, I have opened that file Mysql.php, but at the line 3937 there is a public function to check if all transactions have been committed, nothing more.

I'm running Magento 1.9.0.1


texts: How can i make a slider of product thumbnail images on product page

texts: I am searching for a extension to add product thumbnail image slider in the product page but couldn't find any of the free extension so i can anyone help me in making custom product thumbnail slider for my magento store. any help will be appreciable for me.


texts:
I setup a Magento 2.2.1 version and I can't give any command by git bash. when I give Magento common commands it shows error.

like this:

  $ php bin/magento cache:status Magento supports 7.0.2, 7.0.4, and
  7.0.6 or later. Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html

what I need do now?


texts:
I need to save data to a custom table.

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Npm_Commission>
            <version>0.1.0</version>
        </Npm_Commission>
    </modules>
    <global>
        <events>
            <sales_order_place_after>
                <observers>
                    <npm_commission_model_observer>
                        <type>singleton</type>
                        <class>Npm_Commission_Model_Observer</class>
                        <method>calculateCommission</method>
                    </npm_commission_model_observer>
                </observers>
            </sales_order_place_after>
        </events>
        <models>
            <npm_commission>
                <class>Npm_Commission_Model</class>
                <resourceModel>commission_mysql4</resourceModel>
            </npm_commission>
            <commission_mysql4>
                <class>Npm_Commission_Model_Mysql4</class>
                <entities>
                    <commission>

commission

                    </commission>
                </entities>
            </commission_mysql4>
        </models>
        <resources>
            <commission_setup>
                <setup>
                    <module>Npm_Commission</module>

                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </commission_setup>
            <commission_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </commission_write>
            <commission_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </commission_read>
        </resources>
    </global>
</config>

DATA

$insertData = array(
            'order_id' => $orderId,
            'transaction_id' => $transaction_id,
            'foundation_id' => $foundation_id,
            'mano_admin_fees' => $manoAdminFees,
            'mano_promotion_fees' => $manoPromoFees,
            'paypal_fees' => $payPalFees,
            'foundation_fees' => $foundationFees,
            'created_at' => $created_at
            );

Insert code

$collectionSet = Mage::getModel('commission/commission');
            $collectionSet->setData($insertData)->save();

custom table install script

<?php
$installer = $this;
$installer->startSetup();
$installer->run("DROP TABLE IF EXISTS {$installer->getTable('commission')};
CREATE TABLE {$installer->getTable('commission')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `order_id` int(11) NOT NULL,
  `transaction_id` int(11) NOT NULL,
  `foundation_id` int(11) NOT NULL,
  `mano_admin_fees` decimal(10,2) NOT NULL,
  `mano_promotion_fees` decimal(10,2) NOT NULL,
  `paypal_fees` decimal(10,2) NOT NULL,
  `foundation_fees` decimal(10,2),
  `created_at` datetime,
  PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$installer->endSetup();

I am getting error

Fatal error: Call to a member function setData() on a non-object in


texts: Magento 2 space symbols in storefront error messages are replaced with plus characters

texts:
Does any one have the same question?
I saw this bug cannot be corrected by Magento.
Link: https://devdocs.magento.com/guides/v2.4/release-notes/release-notes-2-4-0-commerce.html
The message code shows below and doesn't include plus(+) characters:
catch (AuthenticationException $e) {
                $message = __('Invalid login or password.');
                $this->messageManager->addError($message);
                $this->session->setUsername($login['username']);

I wanna ask is it possible to solve and how? anyone sloved?


texts:
Can somebody please help me to figure out why I am getting broken links report from semrush, all the urls listed are of products having visibility set to 'Not Visible Individually'.
It is not listing all product URLs with visibility 'Not Visible Individually', only some.


texts: Adding custom field in a order a product process

texts:
I am developing a site in which user can recharge his prepaid card. So Card will have a handling charge (in magento terms product price) and the amount to be added to his card (This will be the custom field).

On product view page I show the text box to fill the recharge amount. So once he move to add to cart, handling fee and recharge amount to be carried to cart. So I should add a custom field into cart process.

I am referring this blog:

I have below question and can not find answer. Can some one please help me.

What are the tables involving in this process?
Will it impact any problems if add a custom field in order process?
Is it acceptable to add a custom field?
If yes is there any guidelines to add a new field?

Thanks in advance.


texts: How to direct include Vue.js  in Magento 2?

texts:
I want to use Vue.js in Magento 2 by the Direct  Include , but, for some reason, the script doesn't call the content and then, the local Vue script doesn't work.

I put the CDN in the header with the others

And is here in the page "loaded"

The HTML and Vue content works in codepen and others platforms

var gobantesCatalogos = new Vue({
  el: '#catalogs',
  data: {
    urlComun: '/pub/media/wysiwyg/catalogo/',
    items: [
      { titulo: 'File1', nombreArchivo: 'FileName1', nombreImagen: 'img1' },
      { titulo: 'File2', nombreArchivo: 'FileName2', nombreImagen: 'img2' },
      { titulo: 'File3', nombreArchivo: 'FileName3', nombreImagen: 'img3' },
      { titulo: 'File4', nombreArchivo: 'FileName4', nombreImagen: 'img4' },
      { titulo: 'File5', nombreArchivo: 'FileName5', nombreImagen: 'img5' },
      { titulo: 'File6', nombreArchivo: 'FileName6', nombreImagen: 'img6' }
    ]
  }
})

Catalogue

{{ item.titulo }}

But, doesn't work in the page. Anyone has tried to use Vue.js in Magento 2 without PWA Vue Storefront?
What did I miss?

Thanks you for read it,


texts: Best seller sort by option in Magento 2.3.4

texts:
I am trying to implement Best seller sort by in category list page.

Followed below link, but that is not working in Magento 2.3.4.

Magento 2 add Sort By Best Sellers Option on category products litsing page

Any suggestions how this can be achieved? the above solution having problem with page load. That is taking more than 20mins to load.

Also it has other problem, collection is not filtering and showing the Best seller items in list page.

Please someone suggest me how can we get Best seller option in sort By in list and search result page. Thanks in Advance!!


texts: Magento 2 Customer login and forgot Password using Rest API

texts: I need customer login and customer forgot password using Magento 2 API. Can you please help me. I was search but not getting any code from google.


texts: Ultimo CMS Home Page - I would like to know about displaying new products with sliders

texts:
I want to output Ultimo's extended function (New in Store) on CMS page with Magento 2.2.4.

However, the Ultimo Theme document does not show how to do it.

If you know how to respond, would you please teach me?

Thank you.


texts:
I am tring to install to get vendor files in magento 2.3 instance using composer.But i am getting following log:

  dealsouq@dcwsrv2401:~/public_html$ composer install

  Loading composer repositories with package information

  Updating dependencies (including require-dev) Package operations: 191
  installs, 2 updates, 0 removals

  Installing vertex/module-tax (3.0.0): Downloading (100%)

  [UnexpectedValueException]  The checksum verification of the file
  failed (downloaded from
  https://repo.magento.com/archives/vertex/module-tax/vertex-module-tax-3.0.0.0.zip)

  install [--prefer-source] [--prefer-dist] [--dry-run] [--dev]
  [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts]
  [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose]
  [-o|--optimize-autoloader] [-a|--classmap-authoritative]
  [--apcu-autoloader] [--ignore-platform-reqs] [--] []...

Any one has idea over this?


texts:
I've isolated a bit of Magento code which accesses a template file catalog\product\view\media.phtml:

<?php echo $this->getImagesMedia(); ?>

How is this different than the below example which does the same thing:

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

The second example makes sense to me because it's defined in the layout.xml.. The first example is easier to implement on a catalog page where you have multiple objects but where is the $this->getImagesMedia() defined or setup?

How would I create a $this->getImagesMediaMobile().. that's my goal.. to have a 2nd way to display images on mobile devices.


texts: Configurable product's product options add to cart "Please specify the product's option(s)."

texts:
I have this strange issue while adding certain child product of configurable. It gives "Please choose specific options (size / colour) of the product and then click the Saved Lists icon." message which is basically "Please specify the product's option(s)." message.

This is custom size attribute with 480+ options.

I am curious whether the code flow got lost in too many filtrations ? I have debugged up to Mage/Catalog/Model/Product/Type/Configurable.php >> method getProductByAttributes >> line number 503 in the attached core file. It gets lost from above line number.

I'll be very thankful for your great help to know what's wrong.

Here is the product url

Options: Width = Wide, Size = 10 (and 6)

The child product has enough qty (more than 10)

This is a live site where requires login to see the price and add to cart so I have created a video walkthrough to show frontend and backend to explain the issue here.

Here is the portion of code where I've reached so far of Mage_Catalog_Model_Product_Type_Configurable

public function getProductByAttributes($attributesInfo, $product = null)
{
    if (is_array($attributesInfo) && !empty($attributesInfo)) {
        $productCollection = $this->getUsedProductCollection($product)->addAttributeToSelect('name');

        foreach ($attributesInfo as $attributeId => $attributeValue) {
            $productCollection->addAttributeToFilter($attributeId, $attributeValue);
        }

        $productObject = $productCollection->getFirstItem();
        if ($productObject->getId()) {

            return $productObject;
        }

        /**
         * Size option's value get lost by here
         * So it returns null
         */

        //Mage::log($attributesInfo, null, 'debug-product-options.txt');

        foreach ($this->getUsedProducts(null, $product) as $productObject) {
            $checkRes = true;
            foreach ($attributesInfo as $attributeId => $attributeValue) {
                $code = $this->getAttributeById($attributeId, $product)->getAttributeCode();

                if ($productObject->getData($code) != $attributeValue) {
                    $checkRes = false;
                }
            }

            if ($checkRes) {
                return $productObject;
            }
        }
    }
    return null;
}


texts: Add custom class per page on MainContent

texts:
I would like to add a custom class in the <main id="maincontent" class="page-main"> the reason I want to do this is because there's a specific pages that need different background color. So let say the home page will be having a background image displayed but when I visit the About Us page I need to make that image into a background color instead. I'm not sure how to do this. Also is it possible to use the custom variable or something to accomplish this? I mean I don't know much about magento and it will be a great help if you can teach me the PROPER way to do it.

PS: I don't have any code to share as I don't know where to start. I'm thinking about the default.xml since I have a custom theme. But I'm not sure how to do it in a dynamic way.


texts: infinit loop when trying to access Admin area customer edit page magento 2.3.2

texts:
after upgrading Magento to the version 2.3.2, I fixed all errors related to project code (app/code app/design)
but when I try to edit a customer in back office I got an infinit loop after that error 500 displays in the browser when Xdebug is enabled I got this error message in log

[Fri Jan 24 11:17:39.065185 2020] [php7:error] [pid 31010] [client 192.168.203.1:53557]
PHP Fatal error:  Uncaught Error: Maximum function nesting level of '15000' reached,
 aborting! in /vendor/magento/framework/ObjectManager/Config/Config.php:163\nStack trace:\n

#0 /vendor/magento/framework/ObjectManager/Config/Config.php(163): ltrim('Magento\\\\Eav\\\\Mod...', '\\\\')\n

#1 vendor/magento/framework/ObjectManager/ObjectManager.php(68): Magento\\Framework\\ObjectManager\\Config\\Config->getPreference('Magento\\\\Eav\\\\Mod...')\n

 #2 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\\Framework\\ObjectManager\\ObjectManager->get('Magento\\\\Eav\\\\Mod...')\n

#3 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->resolveArgument(Array, 'Magento\\\\Eav\\\\Mod...', NULL, 'context', 'Magento\\\\Custome...')\n

#4 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\\Framework\\ObjectMa in /vendor/magento/framework/ObjectManager/Config/Config.php on line 163

after disabling Xdebug I get the error

[Fri Jan 24 17:37:42.849033 2020] [php7:error] [pid 28770] [client 192.168.203.1:56426] PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 4194312 bytes)

in /vendor/magento/framework/Api/ExtensionAttributesFactory.php on line 94, referer: http://test.loc/admin/customer/index/index/key/7874afb7590309f30f529cbcd52aaa2d59e26eec3be2820225cd10f55d09ec5d/

Any help would be appreciated

thanks in advance


texts: Magento 2 - Link from a Libre/Open Office spreadsheet to a customer/order page in Backoffice

texts:
I experience a strange behaviour

Some of my partner uses a spreadsheet in libre office and populate a cell with a hyperlink, like :

  https://backoffice.mydomain.com/admin_xxxxx/sales/order/view/order_id/16423/

a click on this link, in libre office / open office / excel always leads to the backoffice home page, instead of directing to the right page.

Link is allright, copy/paste is ok.

things discovered since original post:

After some apache log read, i noticed that the first http response is a 302.
I also haven't mentionned that the /key/ from the url has been removed by using magento 2 backoffice option.
This has been reproduced on two Magento 2 instance, on two different servers.

anyone having an idea ?


texts: Magento2 when navigating from admin to Web Setup Wizard produces 404 page

texts:
Magento 2.0.2 installed from composer, when I try to navigate to Web Setup Wizard:
http://mg2.com/admin_url/admin/backendapp/redirect/app/setup/
It takes me to http://mg2.com/setup which in turn produces 404 page
Magento is setup to use /pub as document root, with apache mod_php
Any ideas why is it not working?

Update:

Since Magento was configured with pub as site root, I decided that this might cause the issue, so I changed apache config to serve from Magento root.
Did not make any difference, still http://mg2.com/setup produces 404


texts: Magento 1.9.2.1 site caching literally everything. Must manually reload cart, admin panel, etc. to see changes

texts:
I've got a client who has a very odd problem that appeared out of virtually nowhere. It seems that their site is caching absolutely everything that could possibly be cached. I've turned Magento cache off and talked to the hosting company, and there is apparently no caching set up for the site right now.

Right now, if you place an item in your cart for the first time, everything seems to work fine. If you attempt to remove an object, the cart will appear to still have the item in it. The only way to get the cart to update is to refresh the browser 2 or 3 times. If you attempt to put another item into the cart, you must refresh the browser to get it to appear in the cart.

If you log into the admin panel and try to clear cache, reindex, turn on path hints, or really do anything that would show that you updated anything on the back end, you have to refresh the browser to get it to show up. So, for instance, say you tell the site to reindex the search engine. The site will act like it's reindexing, then do the usual auto-refresh, but the search engine will still appear to need indexing (ie it will be red) until you hit F5 to reload. Then the search engine index warning will turn green.

I'm at a loss at this point for why the entire site is caching like this. I have a dev site that is roughly identical to this live site and it's not having any of these problems. The only difference is that the dev site is hosted with a different company entirely.

The only StackExchange post I've seen that resembles this issue is here, but the reported fix didn't work for me. Any help is much appreciated.


texts:
I'm planing to use Magento to sell products with multiple options ( 3-5 ). Each of them changes final price. There is no fixed / percentage connection, so I have to create matrix of prices
Whats the proper way of implementing?

I found this module:  http://www.magentocommerce.com/magento-connect/product-matrix.html, but reviews are bad and its limited to 2 dimensions.

I was thinking about using configurable products based on 4-5 attributes.

Does anybody knows solution / extension that will work for me?


texts:
I create a custom module in Magento 1.9 to upload some images. But I want to have this big images as a thumbnails too, how I can made a resize of the big images?

    if(isset($_FILES['image']['name']) && $_FILES['image']['name'] != null) {
        $result['file'] = '';
        try {
            $uploader = new Varien_File_Uploader('image');
            $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
            $uploader->setAllowRenameFiles(true);
            $uploader->setFilesDispersion(false);
            $path = Mage::getBaseDir('media') . DS.'images/'.DS ;
            $result = $uploader->save($path, $_FILES['image']['name'] );
        } catch (Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage() . '  '. $path);
            Mage::getSingleton('adminhtml/session')->setFormData($data);
            $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
            return;
        }
        $data['image'] = 'images/'.$result['file'];
    }

How I can duplicate and resize uploaded images to create thumbnails automatically.

Thank you


texts:
I am using magefan blog extension and documentation says that extension supports facebook open graph. But when I try to share blog content of facebook it shows some random pictures and content and the og meta tags are not showing. The open graph is working on products, when I share them everything is ok, the content, image, and the og meta tags are visible.

I looked everywhere in the settings but I could not find settings for magefan open graph. Can you please point me in the right direction, what am I missing. Thank you all.


texts: Magento add product programatically with custom option is required field

texts:
I try to add simple product programmatically  it's working fine but i want to add product with custom option how i achieve this?

public function addtocartAction(){
      /* Get Product id From Form Post */
        $product_id = $this->getRequest()->getPost('productids');
      /* Get Product id From Form Post */

      /* Add Product in to Cart */
        $product=new Mage_Catalog_Model_Product();
        $product->load($product_id); // Product Id
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        $quote->addProduct($product); // quantity is 1
        $cart = Mage::getSingleton('checkout/cart');
        $cart->init(); // tried commenting this too!
        $cart->save();
        Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
        $quote->collectTotals()->save();
        $this->_redirectReferer();
        Mage::getSingleton('core/session')->addSuccess('Your product has been Added successfully...');
      /* Add Product in to Cart */
    }

Note I have multiple Custom option i need to get Is Required = Yes option in list.phtml and add it How I achieve this?


texts: Want to display VAT price on Shopping and Checkout page

texts:
I have a product, who's price is 299GBP (UK), and vat for it is 49.83GBP. I want it to be displayed on checkout page and shopping page.
The vat price is displayed in the price section of "Manage Products"correctly(i.e on the Admin backend)
but it is not displaying on the frontend.

Plz help...


texts: Magento 1.9 - Promotions Conditions and Actions not showing

texts:
I have a problem creating the promotion rules for magento, the Add button Conditions and Action does not work.. I click on it but nothing happens.. Has anyone ever gone through this?

Conditions:

Actions:

I tried to follow this step:

  Catalog > Attributes > Manage Attributes > SKU Change "Use for Promo
  Rule Conditions" to "Yes"

But it did not work..
It's as if the click of the + button was not called, it does not open anything..

Any idea?


texts: Custom Magento theme not extending from custom parent theme

texts:
So I'm working on creating a custom parent theme I can reuse for a bunch of different projects and then a child theme for custom styles for a client to extend from that theme.

I had the custom child theme extending from the custom for a little while then one morning I came on and the custom child theme was no longer extending from the parent. Both themes do work.

This is the theme.xml for the custom parent

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Acadaca Base</title>
    <parent>Magento/blank</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

This is the theme.xml for the custom child

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
   <title>Equipment Base</title>
   <parent>Acadaca/base</parent>
   <media>
       <preview_image>media/preview.jpg</preview_image>
   </media>
</theme>

Can anyone offer any advice?


texts: Magento 2 - How to customize "new address" form in checkout?

texts:
In magento you can add a new address during the checkout process.
I need to add a little text at the position seen in the screenshot:

I can't figure out how this is done. I've read through the section "Customize Checkout" in the documentation, but there is nothing helpful which points me in the right direction.
I know that the form can be addressed under this UiComponent path:
checkout.steps.shipping-step.shippingAddress.billing-address-form

But what steps are required to add my changes?
There is no template for this form anywhere.
I dont want to solve it by a dirty javascript workaround.

What I have tried:
THEME\Amasty_Checkout\layout\amasty_checkout.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="required_info" xsi:type="array">
                                                            <item name="component" xsi:type="string">Amasty_Checkout/js/view/required_info</item>
                                                            <item name="template" xsi:type="string">Amasty_Checkout/required_info</item>
                                                            <item name="elementTmpl" xsi:type="string">Amasty_Checkout/required_info</item>
                                                            <item name="provider" xsi:type="string">checkoutProvider</item>
 ...

THEME\Amasty_Checkout\web\template\required_info.html

* Pflichtfelder

THEME\Amasty_Checkout\web\js\view\required_info.js
define([
    'uiComponent'
], function (
    Component
) {
    'use strict';
    return Component.extend({
        initialize: function () {
            this._super();
        }
    });
});


texts:
The url slugs when refining by category on the store, the url displays the parent category twice.

  site.com/x/x/y

In the configuration>web:

 web rewrites: on unsecured
 base url: http://guytgunter.com/shop/
 default web url : catalog/category/view/id/3

Which the catalog would be the shop slug, category would be a variable category and so on.

How do i change my url structure to instead display

  site.com/x/y


texts:
I want to change my Magento 1 site so that all of the products pages are Noindex, follow.

Does anyone know how to do this please?


texts:
I have the following class

<?php
namespace Company\Module\Plugin;

class myClass
{
    protected $_orderRepository;

    public function __construct(
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
    ) {
        $this->_orderRepository = $orderRepository;
    }

    public function processOrder($orderId)
    {

        $order = $this->_orderRepository->get($orderId);

        var_dump($order->getItems());

        exit;
    }
}

However when it gets to running "$order = $this->_orderRepository->get($orderId);" then my system runs out of memory. Am I doing anything wrong?


texts: when i click on add to cart button on bundle product 2 times to add 2 bundle products its shows 0 price on cart page. This is issue only for even qty numbers. if i click 3 time on add to cart button from bundle product then its show me exact price on cart page.


texts: Magento 2: How to display the category in product URL?

texts:
I want to get the product URL with categories in home page where I just load the product collection and used the getProductUrl() function.
But it returns only product URL key.


texts:
in my site runing cron job (but it take RAM and CPU Usage )
So i want to stop cron job

how to stop cron job runing in magento 2


texts: Mage 1.9.2.4 1: 1 website, 1 catalog, multiprice, multicurrency

texts:
I read many many answers. Many have similar questions, but at the end the solution seems to me to build many websites.

My need: Magento 1.9.2.4 to implement 1 website (eg brand.com) with 1 catalog of few products (products are all the same) with different currencies and different prices per country + transactions in the currency of the country NOT the base currency.

Requirement: brand.com/US in USD, brand.com/UK in GBP, brand.com/FR in EUR, brand.com/CH in CHF etc Of course the different folders /US /UK /FR etc will have different languages.

Requirement: Product1 costs 56 USD in US, 57 CHF in Swiss, 62 EUR in EU, etc Product2 same behaviour, etc

Requirement: transactions in US all in USD, in Europe all in EURO, etc

The currency used in transactions must be the one selected by the customer and not the default global one (eg brand.com/US in USD, brand.com/UK in GBP).

OK to consider Magento 2.xx and extensions (either for Mage 1.9 or 2.xx)
OK to create many stores (but don't want to have many catalogues as the products are the same)

PS Customers don't mix the carts with products from different stores, as once changing the store, the cart resets.


texts: Cash on delivery payment method restricted for specific zip codes

texts:
I need disable cash on delivery method restricted for specific zip codes.

I use IWD One Page Checkout for my project


texts: Magento 2.3.2 Element 'sequence': This element is not expected. Expected is ( module )

texts:
I'm using module Sebwite/SmartSearch. When i try to command line:

php bin/magento dev:tests:run default

It show a bug:

Failed asserting that an array is empty.
D:\xampp7212\htdocs\alothemess\bigsale\dev\tests\static\testsuite\Magento\Test\Integrity\Xml\SchemaTest.php:45
D:\xampp7212\htdocs\alothemess\bigsale\vendor\magento\framework\App\Utility\AggregateInvoker.php:56
D:\xampp7212\htdocs\alothemess\bigsale\dev\tests\static\testsuite\Magento\Test\Integrity\Xml\SchemaTest.php:48

Data set: /app/code/Sebwite/SmartSearch/etc/module.xml
Error validating D:/xampp7212/htdocs/alothemess/bigsale/app/code/Sebwite/SmartSearch/etc/module.xml against urn:magento:framework:Module/etc/module.xsd
Array
(
    [0] => Element 'sequence': This element is not expected. Expected is ( module ).
Line: 12

)

Content of file /app/code/Sebwite/SmartSearch/etc/module.xml

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